OSDN Git Service

誰かEntityAtomGrenadeを登録してくれ...
[chemicraft/chemicraft.git] / common / chemicraft / gui / GuiChemicalCombinationTable.java
index 6fac8dc..b6d2114 100644 (file)
@@ -26,16 +26,17 @@ public class GuiChemicalCombinationTable extends GuiContainer {
        public GuiChemicalCombinationTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCombinationTable par2) {
                super(new ContainerChemicalCombinationTable(par1EntityPlayer, par2));
                this.tileentity = par2;
+               this.ySize = 204;
        }
 
        @Override
        public void initGui(){
                super.initGui();
-               this.atomList = new GuiTextField(this.fontRenderer, 92, 7, 80, 15);
+               this.atomList = new GuiTextField(this.fontRenderer, 9, 103, 160, 15);
                this.atomList.setFocused(false);
-               this.atomList.setMaxStringLength(20);
-               this.controlList.add(new GuiButton(0, this.guiLeft + 132 - 41, this.guiTop + 63, 40, 20, "Add"));
-               this.controlList.add(new GuiButton(1, this.guiLeft + 132, this.guiTop + 63, 40, 20, "Eject"));
+               this.atomList.setMaxStringLength(25);
+               this.controlList.add(new GuiButton(0, this.guiLeft + 172 - 41, this.guiTop + 80 - 21, 40, 20, "Add"));
+               this.controlList.add(new GuiButton(1, this.guiLeft + 172 - 41, this.guiTop + 80, 40, 20, "Eject"));
        }
 
        @Override
@@ -47,71 +48,15 @@ public class GuiChemicalCombinationTable extends GuiContainer {
        @Override
        protected void actionPerformed(GuiButton par1GuiButton) {
                if(par1GuiButton.id == 0){
-                       this.field_00001(this.tileentity);
+                       this.tileentity.field_00001();
                        PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
                }else if(par1GuiButton.id == 1){
-                       this.field_00002(this.tileentity);
+                       this.tileentity.field_00002();
                        PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
                }
                return;
        }
 
-       protected void field_00001(TileEntityChemicalCombinationTable par1){
-               IInventory inv = par1.getInvMaterial();
-               ItemStack[] stacks = new ItemStack[inv.getSizeInventory()];
-               for(int i = 0;i < stacks.length;i++){
-                       if(inv.getStackInSlot(i) != null){
-                               stacks[i] = inv.getStackInSlot(i);
-                       }
-               }
-               Arrays.sort(stacks, new ComparatorItemStack());
-               stacks = ChemiCraft.instance.arrayAuxiliary.deleteNull(stacks);
-
-               for(int i = 0;i < stacks.length;i++){
-                       if(stacks[i].stackSize > 1){
-                               par1.setAtoms(ChemiCraft.ATOMSLIST[stacks[i].getItemDamage()], stacks[i].stackSize);
-                       }else{
-                               par1.setAtoms(ChemiCraft.ATOMSLIST[stacks[i].getItemDamage()], 1);
-                       }
-               }
-
-               for(int i = 0;i < inv.getSizeInventory();i++){
-                       inv.setInventorySlotContents(i, null);
-               }
-       }
-
-       protected void field_00002(TileEntityChemicalCombinationTable par1) {
-               ArrayList<String> var1 = par1.getAtomsList();
-               ArrayList<Integer> var2 = par1.getAtomsAmountList();
-
-               for (int i = 0;i < var1.size();i++) {
-                       for (int j = 0;j < ChemiCraft.ATOMSLIST.length;j++) {
-                               if (var1.get(i).equals(ChemiCraft.ATOMSLIST[j])) {
-                                       int var3 = var2.get(i);
-                                       while(var3 > 0){
-                                               if(var3 > 64){
-                                                       ItemStack itemstack = new ItemStack(ChemiCraft.instance.itemAtoms, 64, j);
-                                                       this.tileentity.setDropItems(itemstack);
-                                                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
-                                                       var3 -= 64;
-                                               }else{
-                                                       ItemStack itemstack = new ItemStack(ChemiCraft.instance.itemAtoms, var3, j);
-                                                       this.tileentity.setDropItems(itemstack);
-                                                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
-                                                       var3 = 0;
-                                               }
-                                       }
-                                       break;
-                               }
-                       }
-               }
-               IInventory invr = par1.getInvResult();
-               if (invr.getStackInSlot(0) != null) {
-                       invr.setInventorySlotContents(0, null);
-               }
-               par1.emptytoAtomsList();
-       }
-
        @Override
        protected void drawGuiContainerForegroundLayer() {
                this.atomList.setText(this.tileentity.getAtoms());