@Override public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) { if (!world.isRemote) { MovingObjectPosition mop = getMovingObjectPositionFromPlayer(world, player, true); if (mop != null && mop.typeOfHit == EnumMovingObjectType.TILE) { int blockId = world.getBlockId(mop.blockX, mop.blockY, mop.blockZ); if (MFRRegistry.getFluidDrinkHandlers().containsKey(blockId)) { MFRRegistry.getFluidDrinkHandlers().get(blockId).onDrink(player); world.setBlockToAir(mop.blockX, mop.blockY, mop.blockZ); } } } return stack; }
@Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { MovingObjectPosition mop = getMovingObjectPositionFromPlayer(world, player, true); if (mop != null && mop.typeOfHit == EnumMovingObjectType.TILE) { if (MFRRegistry.getFluidDrinkHandlers() .containsKey(world.getBlockId(mop.blockX, mop.blockY, mop.blockZ))) { player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); } } return stack; }