Skip to content

Commit

Permalink
When breeding imps with Glowshroom Stew, the bowl the soup was in wil…
Browse files Browse the repository at this point in the history
…l be returned to the player.
  • Loading branch information
alexbegt committed Jul 31, 2018
1 parent 0544fb1 commit 6a80df9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Expand Up @@ -129,6 +129,25 @@ public boolean isBreedingItem(ItemStack par1ItemStack)
return !par1ItemStack.isEmpty() && par1ItemStack.getItem() == soups && par1ItemStack.getItemDamage() >= 4;
}

@Override
protected void consumeItemFromStack(EntityPlayer player, ItemStack stack)
{
if (stack.getItem() == soups)
{
ItemStack bowl = soups.getBowlType(stack.getItemDamage());

if (!player.inventory.addItemStackToInventory(bowl))
{
player.dropItem(bowl, false, false);
}
}

if (!player.capabilities.isCreativeMode)
{
stack.shrink(1);
}
}

@Override
public EntityAgeable createChild(EntityAgeable par1EntityAgeable)
{
Expand Down
Expand Up @@ -54,4 +54,9 @@ public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBas

return stack.getCount() <= 0 ? ItemStack.EMPTY : stack;
}

public ItemStack getBowlType(int metadata)
{
return this.bowlsList.get(metadata).copy();
}
}

0 comments on commit 6a80df9

Please sign in to comment.