OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / container / ContainerChemicalCombinationTable.java
index 4e1a37b..e47fd87 100644 (file)
@@ -86,7 +86,7 @@ public class ContainerChemicalCombinationTable extends Container {
 
        @Override
        public void onCraftMatrixChanged(IInventory par1IInventory){
-               this.invr.setInventorySlotContents(0, ChemiCraftAPI.getInstance().getCraftingManager().getChemicalCombinationResult(this.tileentity.getAtomsList(), this.tileentity.getAtomsAmountList()));
+               this.invr.setInventorySlotContents(0, ChemiCraftAPI.instance().getCraftingManager().getChemicalCombinationResult(this.tileentity.getAtomsList(), this.tileentity.getAtomsAmountList()));
                if (par1IInventory instanceof InventoryChemicalCombinationTableResult) {
                        PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
                }
@@ -148,9 +148,25 @@ public class ContainerChemicalCombinationTable extends Container {
                return super.slotClick(par1, par2, par3, par4EntityPlayer);
        }
 
-       @Override
-       public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
+       public void onCraftGuiClosed(EntityPlayer par1EntityPlayer)
+       {
                super.onCraftGuiClosed(par1EntityPlayer);
+
+               if (!this.worldObj.isRemote)
+               {
+                       for (int var2 = 0; var2 < 18; var2++){
+                               ItemStack var3 = null;
+                               if (var2 < 15){
+                                       var3 = this.invm.getStackInSlotOnClosing(var2);
+                               } else if (var2 < 16) {
+                                       var3 = this.invr.getStackInSlotOnClosing(var2 - 15);
+                               }
+
+                               if (var3 != null){
+                                       par1EntityPlayer.dropPlayerItem(var3);
+                               }
+                       }
+               }
        }
 
 }