1 package chemicraft.gui;
3 import java.util.ArrayList;
4 import java.util.Arrays;
6 import net.minecraft.src.EntityItem;
7 import net.minecraft.src.EntityPlayer;
8 import net.minecraft.src.GuiButton;
9 import net.minecraft.src.GuiContainer;
10 import net.minecraft.src.GuiTextField;
11 import net.minecraft.src.IInventory;
12 import net.minecraft.src.ItemStack;
13 import net.minecraft.src.World;
14 import chemicraft.ChemiCraft;
15 import chemicraft.container.ContainerChemicalCombinationTable;
16 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
17 import chemicraft.util.ComparatorItemStack;
18 import cpw.mods.fml.common.network.PacketDispatcher;
20 public class GuiChemicalCombinationTable extends GuiContainer {
22 private GuiTextField atomList;
24 private TileEntityChemicalCombinationTable tileentity;
26 public GuiChemicalCombinationTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCombinationTable par2) {
27 super(new ContainerChemicalCombinationTable(par1EntityPlayer, par2));
28 this.tileentity = par2;
33 public void initGui(){
35 this.atomList = new GuiTextField(this.fontRenderer, 9, 103, 160, 15);
36 this.atomList.setFocused(false);
37 this.atomList.setMaxStringLength(25);
38 this.controlList.add(new GuiButton(0, this.guiLeft + 172 - 41, this.guiTop + 80 - 21, 40, 20, "Add"));
39 this.controlList.add(new GuiButton(1, this.guiLeft + 172 - 41, this.guiTop + 80, 40, 20, "Eject"));
43 protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
44 this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCombinationTexture));
45 this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
49 protected void actionPerformed(GuiButton par1GuiButton) {
50 if(par1GuiButton.id == 0){
51 this.tileentity.field_00001();
52 PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
53 }else if(par1GuiButton.id == 1){
54 this.tileentity.field_00002();
55 PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
61 protected void drawGuiContainerForegroundLayer() {
62 this.atomList.setText(this.tileentity.getAtoms());
63 this.atomList.drawTextBox();