public void breakBlock(World world, int x, int y, int z, int par5, int par6) { if (!world.isRemote) { TileEntityEIHMixer te = (TileEntityEIHMixer) world.getBlockTileEntity(x, y, z); if (te.isDoneMixing()) { te.retrieveResult(); } else { te.emptyMixer(); } } super.breakBlock(world, x, y, z, par5, par6); }
@Override public boolean onBlockActivated( World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { if (world.isRemote) { return true; } ItemStack stack = entityPlayer.getCurrentEquippedItem(); TileEntityEIHMixer mixer = (TileEntityEIHMixer) world.getBlockTileEntity(x, y, z); if (mixer.isDoneMixing()) { mixer.retrieveResult(); return true; } if (stack == null) { mixer.emptyMixer(); return true; } ItemStack ingredientStack = stack.copy(); ingredientStack.stackSize = 1; if ( /*MixerRecipeRegistry.getInstance().isRegisteredIngredient(ingredientStack) &&*/ mixer .addToMixer(ingredientStack)) { entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); } if (stack.itemID == TropicraftMod.bambooMugEmpty.shiftedIndex && mixer.canMix()) { mixer.startMixing(); entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); } return true; }