This commit is contained in:
Shadows_of_Fire 2018-04-13 13:19:52 -04:00
parent 981a0c6ae1
commit b91bde4d74

View file

@ -139,7 +139,7 @@ public class ItemWaterBowl extends ItemBase{
if(entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)entity;
if(this.tryPlaceContainedLiquid(player, world, player.getPosition(), true)){
player.inventory.setInventorySlotContents(itemSlot, new ItemStack(Items.BOWL));
checkReplace(player, stack, new ItemStack(Items.BOWL), itemSlot);
}
}
}
@ -159,6 +159,11 @@ public class ItemWaterBowl extends ItemBase{
}
}
}
private void checkReplace(EntityPlayer player, ItemStack old, ItemStack stack, int slot) {
if(player.inventory.getStackInSlot(slot) == old) player.inventory.setInventorySlotContents(slot, stack);
else if(player.inventory.offHandInventory.get(slot) == old) player.inventory.offHandInventory.set(slot, stack);
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged){