Skip to content

Commit

Permalink
Drop Glass Bottles
Browse files Browse the repository at this point in the history
Glass bottles drop if inventory is full
  • Loading branch information
Charles445 committed Sep 17, 2021
1 parent 51ffee8 commit dab3f58
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,20 @@ public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase
this.runSecondaryEffect(player, stack);

stack.shrink(1);

ItemStack glassBottle = new ItemStack(Items.GLASS_BOTTLE);

if(stack.isEmpty())
{
return new ItemStack(Items.GLASS_BOTTLE);
return glassBottle;
}
else
{
player.inventory.addItemStackToInventory(new ItemStack(Items.GLASS_BOTTLE));
if (!player.inventory.addItemStackToInventory(glassBottle))
{
player.dropItem(glassBottle, false);
}

return stack;
}
}
Expand Down

0 comments on commit dab3f58

Please sign in to comment.