package com.harry9137.ct.client.container; import com.harry9137.ct.tileentity.TileEntityGenerator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; public class ContainerGenerator extends Container { public ContainerGenerator(InventoryPlayer inventoryPlayer, TileEntityGenerator te, int xSize, int ySize){ super(); bindSlots(inventoryPlayer, te, xSize, ySize); } public void bindSlots(InventoryPlayer inventoryPlayer, TileEntityGenerator te, int xSize, int ySize){ addSlotToContainer(new Slot(te, 0, 79, 19)); int leftCol = (xSize - 162) / 2 + 1; for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++) { for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++) { addSlotToContainer(new Slot(inventoryPlayer, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10)); } } for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++) { addSlotToContainer(new Slot(inventoryPlayer, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24)); } } @Override public boolean canInteractWith(EntityPlayer p_75145_1_) { return true; } }