OSDN Git Service

化合台がResultクリックしても素材が入れっぱなしなので修正
authormozipi <mozipi@users.sourceforge.jp>
Thu, 3 Jan 2013 14:13:47 +0000 (23:13 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Thu, 3 Jan 2013 14:13:47 +0000 (23:13 +0900)
common/chemicraft/ChemiCraft.java
common/chemicraft/container/ContainerChemicalCombinationTable.java
common/chemicraft/tileentity/TileEntityChemicalCombinationTable.java

index 2bd896c..357baa7 100644 (file)
@@ -301,14 +301,17 @@ public class ChemiCraft {
                });\r
 \r
                // 化合物を追加します\r
-               ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
-               ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "Water", "水");\r
+               api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
+               api.addLangCompound("ja_JP", "Water", "水");\r
 \r
                //化合物のHandlerを設定します\r
-               ChemiCraftAPI.getInstance().settingCompoundHandler("Water", new CompoundWater());\r
+               api.settingCompoundHandler("Water", new CompoundWater());\r
+\r
+               //化合物のレシピを追加します\r
+               api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, 1));\r
 \r
                //手榴弾の追加\r
-               ChemiCraftAPI.getInstance().addMaterialRecipe(\r
+               api.addMaterialRecipe(\r
                                new ItemStack[]{\r
                                                null,\r
                                                new ItemStack(Block.stone),\r
@@ -332,12 +335,6 @@ public class ChemiCraft {
        }\r
 \r
        private void debug(final FMLPostInitializationEvent event) {\r
-               //デバッグ処理\r
-               api.addChemicalCombinationRecipe(\r
-                               new String[]{ChemiCraftData.HYDROGEN_SIGN, ChemiCraftData.OXYGEN_SIGN},\r
-                               new Integer[]{2, 1},\r
-                               new ItemStack(Block.dirt)\r
-                               );\r
        }\r
 \r
 }
\ No newline at end of file
index e671966..db89f56 100644 (file)
@@ -102,10 +102,9 @@ public class ContainerChemicalCombinationTable extends Container {
 
        @Override
        public ItemStack slotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {
-               if (par1 == 16) {
+               if (par1 == 15) {
                        if (this.invr.getStackInSlot(0) != null) {
                                this.tileentity.emptytoAtomsList();
-                               return super.slotClick(par1, par2, par3, par4EntityPlayer);
                        }
                }
                return super.slotClick(par1, par2, par3, par4EntityPlayer);
index 8a0ae46..ab84c7c 100644 (file)
@@ -11,6 +11,7 @@ import net.minecraft.src.NBTTagCompound;
 import net.minecraft.src.NBTTagList;
 import net.minecraft.src.Packet;
 import net.minecraft.src.TileEntity;
+import net.minecraft.src.WorldServer;
 import chemicraft.ChemiCraft;
 import chemicraft.ChemiCraftData;
 import chemicraft.inventory.InventoryChemicalCombinationTableMaterial;
@@ -43,6 +44,13 @@ public class TileEntityChemicalCombinationTable extends TileEntity {
                        this.isProvidePower = false;
                        PacketDispatcher.sendPacketToAllPlayers(this.getDescriptionPacket());
                }
+               if (this.worldObj instanceof WorldServer) {
+                       System.out.println(this.atomsList + ":Server");
+                       System.out.println(this.atomsAmountList + ":Server");
+               } else {
+                       System.out.println(this.atomsList + ":Client");
+                       System.out.println(this.atomsAmountList + ":Client");
+               }
        }
 
        @Override
@@ -254,6 +262,7 @@ public class TileEntityChemicalCombinationTable extends TileEntity {
                        this.atomsList.add(par1);
                        this.atomsAmountList.add(par2);
                }
+               PacketDispatcher.sendPacketToAllPlayers(this.getDescriptionPacket());
        }
 
        public void setDropItems(ItemStack par1ItemStack){