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