@Override public void onContainerClosed(EntityPlayer entityplayer) { super.onContainerClosed(entityplayer); tileEntity.close(entityplayer); tileEntity.closeInventory(); }
public ContainerFluidicPlenisher(InventoryPlayer inventory, TileEntityFluidicPlenisher tentity) { tileEntity = tentity; addSlotToContainer(new Slot(tentity, 0, 28, 20)); addSlotToContainer(new SlotOutput(tentity, 1, 28, 51)); addSlotToContainer(new SlotDischarge(tentity, 2, 143, 35)); int slotX; for (slotX = 0; slotX < 3; ++slotX) { for (int slotY = 0; slotY < 9; ++slotY) { addSlotToContainer( new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 84 + slotX * 18)); } } for (slotX = 0; slotX < 9; ++slotX) { addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142)); } tileEntity.open(inventory.player); tileEntity.openInventory(); }
@Override public boolean canInteractWith(EntityPlayer entityplayer) { return tileEntity.isUseableByPlayer(entityplayer); }