package noppes.npcs.containers; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import noppes.npcs.entity.EntityNPCInterface; import noppes.npcs.roles.RoleTrader; public class ContainerNPCTraderSetup extends Container { public RoleTrader role; public ContainerNPCTraderSetup(EntityNPCInterface npc, EntityPlayer player) { role = (RoleTrader) npc.roleInterface; // New layout: $[Currency TextField], Item Cost 1, Item Cost 2, =, Output // Column width: 130px for better spacing for (int i = 0; i < 18; i++) { int x = 7; x += i % 3 * 130; int y = 15; y += i / 3 * 22; // Item Cost 1 (primary currency) addSlotToContainer(new Slot(role.inventoryCurrency, i, x + 51, y)); // Item Cost 2 (secondary currency) addSlotToContainer(new Slot(role.inventoryCurrency, i + 18, x + 69, y)); // Output (sold item) addSlotToContainer(new Slot(role.inventorySold, i, x + 105, y)); } for (int i1 = 0; i1 < 3; i1++) { for (int l1 = 0; l1 < 9; l1++) { addSlotToContainer(new Slot(player.inventory, l1 + i1 * 9 + 9, 48 + l1 * 18, 147 + i1 * 18)); } } for (int j1 = 0; j1 < 9; j1++) { addSlotToContainer(new Slot(player.inventory, j1, 48 + j1 * 18, 205)); } } @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int i) { return null; } @Override public boolean canInteractWith(EntityPlayer entityplayer) { return true; } }