@Override public void onContainerClosed(EntityPlayer entityPlayer) { if (ioSlots.getStackInSlot(1) != null && !player.worldObj.isRemote) { entityPlayer.worldObj.spawnEntityInWorld( new EntityItem( player.worldObj, entityPlayer.posX, player.posY, player.posZ, ioSlots.getStackInSlot(1))); ioSlots.setInventorySlotContents(1, null); } super.onContainerClosed(entityPlayer); }
@Override public ItemStack slotClick(int slot, int button, int p_75144_3_, EntityPlayer player1) { if (slot == 37 && player1.inventory.getItemStack() == null) { if (reactor.reactorFuel / 144 >= 64) { int i = reactor.reactorFuel / 1296; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModBlocks.draconicBlock, i2); reactor.reactorFuel -= i2 * 1296; } else if (reactor.reactorFuel >= 144) { int i = reactor.reactorFuel / 144; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModItems.draconicIngot, i2); reactor.reactorFuel -= i2 * 144; } else if (reactor.reactorFuel >= 16) { int i = reactor.reactorFuel / 16; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModItems.nugget, i2, 1); reactor.reactorFuel -= i2 * 16; } else if (reactor.convertedFuel / 144 >= 64) { int i = reactor.convertedFuel / 1296; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModItems.chaosFragment, i2, 2); reactor.convertedFuel -= i2 * 1296; } else if (reactor.convertedFuel >= 144) { int i = reactor.convertedFuel / 144; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModItems.chaosFragment, i2, 1); reactor.convertedFuel -= i2 * 144; } else if (reactor.convertedFuel >= 16) { int i = reactor.convertedFuel / 16; int i2 = Math.min(64, i); ioSlots.getStorage()[1] = new ItemStack(ModItems.chaosFragment, i2, 0); reactor.convertedFuel -= i2 * 16; } } return super.slotClick(slot, button, p_75144_3_, player1); }