OSDN Git Service

ミスってたので再うp
authorponkotate <ponkotate@users.sourceforge.jp>
Sun, 3 Feb 2013 09:50:44 +0000 (18:50 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sun, 3 Feb 2013 09:50:44 +0000 (18:50 +0900)
69 files changed:
common/chemicraft/ChemiCraft.java [new file with mode: 0644]
common/chemicraft/ChemiCraftAPI.java [new file with mode: 0644]
common/chemicraft/ChemiCraftData.java [new file with mode: 0644]
common/chemicraft/block/BlockChemicalCombinationTable.java [new file with mode: 0644]
common/chemicraft/block/BlockChemicalCraftingTable.java [new file with mode: 0644]
common/chemicraft/block/BlockPyrolysisTable.java [new file with mode: 0644]
common/chemicraft/block/BlockToolAndWeaponCraftingTable.java [new file with mode: 0644]
common/chemicraft/compounds/CompoundWater.java [new file with mode: 0644]
common/chemicraft/container/ContainerChemicalCombinationTable.java [new file with mode: 0644]
common/chemicraft/container/ContainerChemicalCraftingTable.java [new file with mode: 0644]
common/chemicraft/container/ContainerPyrolysisTable.java [new file with mode: 0644]
common/chemicraft/container/ContainerToolAndWeaponCraftingTable.java [new file with mode: 0644]
common/chemicraft/debug/CommandDeleteItem.java [new file with mode: 0644]
common/chemicraft/debug/CommandGenDebugRoom.java [new file with mode: 0644]
common/chemicraft/debug/CommandSetTile.java [new file with mode: 0644]
common/chemicraft/debug/CompoundHandlerTest.java [new file with mode: 0644]
common/chemicraft/debug/DebugData.java [new file with mode: 0644]
common/chemicraft/debug/DebugTick.java [new file with mode: 0644]
common/chemicraft/debug/SetBlockSupport.java [new file with mode: 0644]
common/chemicraft/entity/EntityAtomsGrenade.java [new file with mode: 0644]
common/chemicraft/gui/GuiChemicalCombinationTable.java [new file with mode: 0644]
common/chemicraft/gui/GuiChemicalCraftingTable.java [new file with mode: 0644]
common/chemicraft/gui/GuiPyrolysisTable.java [new file with mode: 0644]
common/chemicraft/gui/GuiToolAndWeaponCraftingTable.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryChemicalCombinationTableMaterial.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryChemicalCombinationTableResult.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryChemicalCraftingMaterial.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryChemicalCraftingNBT.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryChemicalCraftingResult.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryPyrolysisTableFuel.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryPyrolysisTableMaterial.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryPyrolysisTableResult.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableMaterial.java [new file with mode: 0644]
common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableResult.java [new file with mode: 0644]
common/chemicraft/item/ItemAtomInfoContainer.java [new file with mode: 0644]
common/chemicraft/item/ItemAtoms.java [new file with mode: 0644]
common/chemicraft/item/ItemAtomsGrenade.java [new file with mode: 0644]
common/chemicraft/item/ItemCompounds.java [new file with mode: 0644]
common/chemicraft/item/ItemGasCollectingBottle.java [new file with mode: 0644]
common/chemicraft/render/RenderAtomsGrenade.java [new file with mode: 0644]
common/chemicraft/slot/SlotChemicalCombinationTableMaterial.java [new file with mode: 0644]
common/chemicraft/slot/SlotChemicalCombinationTableResult.java [new file with mode: 0644]
common/chemicraft/slot/SlotChemicalCraftingTableResult.java [new file with mode: 0644]
common/chemicraft/slot/SlotPyrolysisTableFuel.java [new file with mode: 0644]
common/chemicraft/slot/SlotPyrolysisTableMaterial.java [new file with mode: 0644]
common/chemicraft/slot/SlotPyrolysisTableResult.java [new file with mode: 0644]
common/chemicraft/slot/SlotToolAndWeaponCraftingTableResult.java [new file with mode: 0644]
common/chemicraft/system/ChemiCraftCraftingManager.java [new file with mode: 0644]
common/chemicraft/system/CommonProxy.java [new file with mode: 0644]
common/chemicraft/system/PacketHandler.java [new file with mode: 0644]
common/chemicraft/tileentity/TileEntityChemicalCombinationTable.java [new file with mode: 0644]
common/chemicraft/tileentity/TileEntityChemicalCraftingTable.java [new file with mode: 0644]
common/chemicraft/tileentity/TileEntityPyrolysisTable.java [new file with mode: 0644]
common/chemicraft/tileentity/TileEntityToolAndWeaponCraftingTable.java [new file with mode: 0644]
common/chemicraft/util/AtomInfo.java [new file with mode: 0644]
common/chemicraft/util/Auxiliary.java [new file with mode: 0644]
common/chemicraft/util/ChemicalNBTRecipe.java [new file with mode: 0644]
common/chemicraft/util/ChunkProviderChemical.java [new file with mode: 0644]
common/chemicraft/util/ComparatorFormulaPart.java [new file with mode: 0644]
common/chemicraft/util/ComparatorItemStack.java [new file with mode: 0644]
common/chemicraft/util/CreativeTabAtoms.java [new file with mode: 0644]
common/chemicraft/util/FormulaPart.java [new file with mode: 0644]
common/chemicraft/util/ICompoundHandler.java [new file with mode: 0644]
common/chemicraft/util/MaterialRecipe.java [new file with mode: 0644]
common/chemicraft/util/MathHelperPlus.java [new file with mode: 0644]
common/chemicraft/util/NBTRecipeGrenade.java [new file with mode: 0644]
common/chemicraft/util/WorldProviderChemical.java [new file with mode: 0644]
common/chemicraft/util/WorldTypeChemical.java [new file with mode: 0644]
アカウント関係.txt [new file with mode: 0644]

diff --git a/common/chemicraft/ChemiCraft.java b/common/chemicraft/ChemiCraft.java
new file mode 100644 (file)
index 0000000..290790b
--- /dev/null
@@ -0,0 +1,346 @@
+package chemicraft;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.BiomeManager;
+import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.common.Property;
+import chemicraft.block.BlockChemicalCombinationTable;
+import chemicraft.block.BlockChemicalCraftingTable;
+import chemicraft.block.BlockPyrolysisTable;
+import chemicraft.block.BlockToolAndWeaponCraftingTable;
+import chemicraft.compounds.CompoundWater;
+import chemicraft.debug.CommandDeleteItem;
+import chemicraft.debug.CommandGenDebugRoom;
+import chemicraft.debug.CommandSetTile;
+import chemicraft.item.ItemAtoms;
+import chemicraft.item.ItemAtomsGrenade;
+import chemicraft.item.ItemCompounds;
+import chemicraft.item.ItemGasCollectingBottle;
+import chemicraft.system.CommonProxy;
+import chemicraft.system.PacketHandler;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+import chemicraft.util.Auxiliary;
+import chemicraft.util.Auxiliary.ArrayAuxiliary;
+import chemicraft.util.Auxiliary.NameAuxiliary;
+import chemicraft.util.CreativeTabAtoms;
+import chemicraft.util.NBTRecipeGrenade;
+import chemicraft.util.WorldProviderChemical;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.SidedProxy;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+/**
+ * ChemiCraft本体
+ * @author P.C.C.
+ *
+ */
+@Mod(modid = "chemiCraft", name = "ChemiCraft", version = "beta")
+@NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraft", packetHandler = PacketHandler.class)
+public class ChemiCraft {
+
+       public static final String[] ATOMSNAME = {
+               "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon",
+               "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium",
+               "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttorium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium",
+               "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium",
+               "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum",
+               "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium",
+               "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium",
+               "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Ununtrium", "Ununquadium", "Ununpentium", "Ununhexium", "Ununseptium", "Ununoctium" };
+
+       public static final String[] ATOMSNAMEJP = {
+               "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン", "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム",
+               "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素", "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム",
+               "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル", "ヨウ素", "キセノン", "セシウム", "バリウム", "ランタン", "セリウム", "プラセオジム", "ネオジム", "プロメチウム", "サマリウム", "ユウロビウム", "ガドリニウム", "テルビウム", "ジスプロニウム",
+               "ホルミウム", "エルビウム", "ツリウム", "イッテルビウム", "ルテチウム", "ハフニウム", "タンタル", "タングステン", "レニウム", "オスミウム", "イリジウム", "白金", "金", "水銀", "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン", "フランシウム", "ラジウム",
+               "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム", "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム",
+               "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", "レントゲニウム", "コペルニシウム", "ウンウントリウム", "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "ウンウンセプチウム", "ウンウンオクチウム" };
+
+       /**
+        * このmodのインスタンス
+        */
+       @Mod.Instance("chemiCraft")
+       public static ChemiCraft instance;
+
+       /**
+        * ChemiCraftのProxy.
+        */
+       @SidedProxy(clientSide = "chemicraft.client.ClientProxy", serverSide = "chemicraft.system.CommonProxy")
+       public static CommonProxy proxy;
+
+       /**
+        * ChemiCraftのCreativeTab.
+        */
+       public static final CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");
+
+       /**
+        * ItemID.
+        */
+       public int atomsID;
+       public int compoundsID;
+       public int gasCollectingBottleID;
+       public int atomGrenadeID;
+
+       /**
+        * BlockID.
+        */
+       public int pyrolysisTableID;
+       public int chemicalConbinationTableID;
+       public int toolAndWeaponCraftingTableID;
+       public int chemicalCraftingTableID;
+
+       /**
+        * GUIID.
+        */
+       public int guiPyrolysisTableID;
+       public int guiChemicalCombinationTableID;
+       public int guiToolAndWeaponCraftingTableID;
+       public int guiChemicalCraftingTableID;
+
+       /**
+        * Block型変数.
+        */
+       public Block blockPyrolysisTable;
+       public Block blockChemicalCombinationTable;
+       public Block blockToolAndWeaponCraftingTable;
+       public Block blockChemicalCraftingTable;
+
+       /**
+        * Item型変数.
+        */
+       public Item itemAtoms;
+       public Item itemCompounds;
+       public Item itemGasCollectingBottle;
+       public Item itemAtomGrenade;
+
+       /**
+        * このmodで使用するTextureのパス.
+        */
+       public String itemAtomsTexture = "/chemicraft/items/Atoms.png";
+       public String itemCompoundsTexture = "/chemicraft/items/Compounds.png";
+       public String itemTexture = "/chemicraft/items/items.png";
+       public String blockChemicalCraftingTableTexture = "/chemicraft/blocks/cctable.png";
+       public String guiPyrolysisTexture = "/chemicraft/guis/Pyrolysis.png";
+       public String guiChemicalCombinationTexture = "/chemicraft/guis/ChemicalCombination.png";
+       public String guiToolAndWeaponCraftingTexture = "/chemicraft/guis/ToolAndWeaponCrafting.png";
+       public String guiChemicalCraftingTexture = "/chemicraft/guis/MaterialCrafting.png";
+
+       /**
+        * このmodに必要な補助クラスのインスタンス.
+        */
+       public Auxiliary auxiliary = new Auxiliary();
+       public NameAuxiliary nameAuxiliary = new NameAuxiliary();
+       public ArrayAuxiliary arrayAuxiliary = new ArrayAuxiliary();
+
+       private ChemiCraftAPI api = ChemiCraftAPI.getInstance();
+       private ChemiCraftData chemicalData = new ChemiCraftData();
+
+       @Mod.PreInit
+       public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
+               Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
+               cfg.load();
+
+               Property pyrolysisTableIDProp = cfg.getBlock("PyrolysisTable", 2400);
+               Property chemicalCombinationTableIDProp = cfg.getBlock("ChemicalCombinationID", 2401);
+               Property toolAndWeaponCraftingTableIDProp = cfg.getBlock("ToolAndWeaponCraftingTableID", 2402);
+               Property chemicalCraftingTableIDProp = cfg.getBlock("ChemicalCraftingTableID", 2403);
+
+               Property atomsIDProp = cfg.getItem("AtomsID", 25000);
+               Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);
+               Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);
+               Property atomGrenadeIDProp = cfg.getItem("AtomGrenadeID", 25003);
+
+               Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);
+               Property guiChemicalCombinationTableIDProp = cfg.get("GUI", "GUIChemicalCombinationTableID", 1001);
+               Property guiToolAndWeaponCraftingTableIDProp = cfg.get("GUI", "GUIToolAndWeaponCraftingTableID", 1002);
+               Property guiChemicalCraftingTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1003);
+
+
+               this.pyrolysisTableID = pyrolysisTableIDProp.getInt();
+               this.chemicalConbinationTableID = chemicalCombinationTableIDProp.getInt();
+               this.toolAndWeaponCraftingTableID = toolAndWeaponCraftingTableIDProp.getInt();
+               this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();
+               this.atomsID = atomsIDProp.getInt();
+               this.compoundsID = compoundsIDProp.getInt();
+               this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();
+               this.atomGrenadeID = atomGrenadeIDProp.getInt();
+               this.guiPyrolysisTableID = guiPyrolysisTableIDProp.getInt();
+               this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();
+               this.guiToolAndWeaponCraftingTableID = guiToolAndWeaponCraftingTableIDProp.getInt();
+               this.guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();
+
+               cfg.save();
+       }
+
+       @Mod.ServerStarting
+       public void serverStarting(final FMLServerStartingEvent event) {
+               event.registerServerCommand(new CommandSetTile());
+               event.registerServerCommand(new CommandDeleteItem());
+               event.registerServerCommand(new CommandGenDebugRoom());
+       }
+
+       @Mod.PostInit
+       public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {
+               this.settingProcessing(event);
+               this.apiProcessing(event);
+               this.debug(event);
+       }
+
+       private void settingProcessing(final FMLPostInitializationEvent event) {
+
+               // Blockを追加します
+               this.blockPyrolysisTable = new BlockPyrolysisTable(this.pyrolysisTableID, 0, Material.ground).
+                               setHardness(2.0F).
+                               setResistance(0.0F).
+                               setStepSound(Block.soundStoneFootstep).
+                               setBlockName("PyrolysisTable");
+               this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).
+                               setHardness(2.0F).
+                               setResistance(0.0F).
+                               setStepSound(Block.soundStoneFootstep).
+                               setBlockName("ChemicalCombinationTable");
+               this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 0, Material.ground).
+                               setHardness(2.0F).
+                               setResistance(0.0F).
+                               setStepSound(Block.soundStoneFootstep).
+                               setBlockName("ToolAndWeaponCraftingTable");
+               this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(chemicalCraftingTableID, 0, Material.ground).
+                               setHardness(2.0F).
+                               setResistance(0.0F).
+                               setStepSound(Block.soundStoneFootstep).
+                               setBlockName("ChemicalCraftingTable");
+
+               // Itemを追加します
+               this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");
+               this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");
+               this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
+               this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
+
+               // BlockをMinecraftに登録します
+               GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
+               GameRegistry.registerBlock(this.blockChemicalCombinationTable, "BlockChemicalCombinationTable");
+               GameRegistry.registerBlock(this.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");
+               GameRegistry.registerBlock(this.blockChemicalCraftingTable, "BlockMaterialCraftingTable");
+
+               // Blockの名前を設定します
+               this.nameAuxiliary.addName(this.blockPyrolysisTable, "PyrolysisTable");
+               this.nameAuxiliary.addName(this.blockPyrolysisTable, "ja_JP", "熱分解台");
+               this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ChemicalCombinationTable");
+               this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ja_JP", "化合台");
+               this.nameAuxiliary.addName(blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");
+               this.nameAuxiliary.addName(blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");
+               this.nameAuxiliary.addName(blockChemicalCraftingTable, "ChemicalCraftingTable");
+               this.nameAuxiliary.addName(blockChemicalCraftingTable, "ja_JP", "素材製作台");
+
+               // Itemの名前を設定します
+               this.nameAuxiliary.addName(this.itemAtoms, ATOMSNAME);
+               this.nameAuxiliary.addName(this.itemAtoms, "ja_JP", ATOMSNAMEJP);
+               this.nameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");
+               this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");
+               this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");
+               this.nameAuxiliary.addName(this.itemAtomGrenade, "元素手榴弾");
+
+               // TileEntityを追加します
+               GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");
+               GameRegistry.registerTileEntity(TileEntityChemicalCombinationTable.class, "TileEntityChemicalCombinationTable");
+               GameRegistry.registerTileEntity(TileEntityToolAndWeaponCraftingTable.class, "TileEntityToolAndWeaponCraftingTable");
+               GameRegistry.registerTileEntity(TileEntityChemicalCraftingTable.class, "TileEntityChemicalCraftingTable");
+
+               // GUIを追加します
+               NetworkRegistry.instance().registerGuiHandler(instance, proxy);
+
+               // 描画関係の読み込み
+               proxy.registerRenderInformation();
+
+               //化学作業台類のレシピを追加します
+               GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),
+                               new Object[]{
+                       "XYX", "ZAZ", "ZZZ",
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),
+                       Character.valueOf('Z'), new ItemStack(Block.stone),
+                       Character.valueOf('A'), new ItemStack(Item.bucketLava),
+               });
+               GameRegistry.addRecipe(new ItemStack(this.blockChemicalCombinationTable),
+                               new Object[]{
+                       "XYX", "ZAZ", "ZZZ",
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),
+                       Character.valueOf('Z'), new ItemStack(Block.stone),
+                       Character.valueOf('A'), new ItemStack(Block.obsidian),
+               });
+               GameRegistry.addRecipe(new ItemStack(this.blockToolAndWeaponCraftingTable),
+                               new Object[]{
+                       "XYX", "ZAZ", "ZZZ",
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),
+                       Character.valueOf('Z'), new ItemStack(Block.stone),
+                       Character.valueOf('A'), new ItemStack(Item.pickaxeSteel),
+               });
+               GameRegistry.addRecipe(new ItemStack(this.blockChemicalCraftingTable),
+                               new Object[]{
+                       "XYX", "ZAZ", "ZZZ",
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),
+                       Character.valueOf('Z'), new ItemStack(Block.stone),
+                       Character.valueOf('A'), new ItemStack(this.itemAtoms, 1, 0),
+               });
+
+               // 化合物を追加します
+               api.addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
+               api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
+               api.addLangCompound("ja_JP", "Water", "水");
+               api.addCompound("Test");
+
+
+               //化合物のHandlerを設定します
+               api.settingCompoundHandler("Water", new CompoundWater());
+
+               //化合物のレシピを追加します
+               api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("Water")));
+
+               //手榴弾の追加
+               api.addMaterialRecipe(
+                               new ItemStack[]{
+                                               null,
+                                               new ItemStack(Block.stone),
+                                               null,
+                                               new ItemStack(Block.stone),
+                                               new ItemStack(Item.gunpowder),
+                                               new ItemStack(Block.stone),
+                                               null,
+                                               new ItemStack(Block.stone),
+                                               null
+                               },
+                               new ItemStack(this.itemAtomGrenade, 16, 0),
+                               new NBTRecipeGrenade()
+                               );
+               //Tickingの追加
+               this.proxy.registerTickHandler();
+       }
+
+       private void apiProcessing(final FMLPostInitializationEvent event) {
+               // API用の処理
+               this.nameAuxiliary.addName(itemCompounds, api.getInstance().getCompoundsName().toArray());
+               for (int i = 0; i < api.getCompoundsLang().size(); i++) {
+                       this.nameAuxiliary.addName(itemCompounds, api.getCompoundsLang().get(i), api.getInstance().getCompoundsLangName().toArray());
+               }
+       }
+
+       private void debug(final FMLPostInitializationEvent event) {
+       }
+
+}
diff --git a/common/chemicraft/ChemiCraftAPI.java b/common/chemicraft/ChemiCraftAPI.java
new file mode 100644 (file)
index 0000000..b7b64e6
--- /dev/null
@@ -0,0 +1,291 @@
+package chemicraft;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import net.minecraft.item.ItemStack;
+import chemicraft.system.ChemiCraftCraftingManager;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+import chemicraft.util.ChemicalNBTRecipe;
+import chemicraft.util.ICompoundHandler;
+import chemicraft.util.MaterialRecipe;
+
+/**
+ * ChemiCraftのAPI
+ * 基本的にAddonはこのクラスのインスタンスを使う
+ * @author mozipi
+ *
+ */
+public class ChemiCraftAPI {
+
+       /**
+        * Instance of the ChemiCraftAPI.
+        */
+       private static ChemiCraftAPI instance = new ChemiCraftAPI();
+
+
+       /**
+        * List of compounds names.
+        */
+       private ArrayList<String> compoundsNameList = new ArrayList<String>();
+
+
+       /**
+        * List of compounds names(Some kind of language).
+        */
+       private ArrayList<String> compoundsLangNameList = new ArrayList<String>();
+
+
+       /**
+        * List of compounds the language names.
+        */
+       private ArrayList<String> compoundsLangList = new ArrayList<String>();
+
+
+       /**
+        * List of compounds handlers.
+        */
+       private ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
+
+
+       /**
+        * 化合物の文字列をダメージ値に変換します。
+        */
+       private HashMap<String, Integer> compoundHash = new HashMap<String, Integer>();
+
+
+       /**
+        * List of item name of handler to compounds.
+        */
+       private ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
+
+
+       /**
+        * 分解台の素材のリスト
+        */
+       private ArrayList<ItemStack> decompositionMaterial = new ArrayList<ItemStack>();
+
+
+       /**
+        * 分解台の結果のリスト
+        */
+       private ArrayList<ItemStack[]> decompositionResults = new ArrayList<ItemStack[]>();
+
+
+       /**
+        * 化合台の原子の種類のリスト
+        */
+       private ArrayList<String[]> chemicalCombinationAtoms = new ArrayList<String[]>();
+
+
+       /**
+        * 化合台の原子の数のリスト
+        */
+       private ArrayList<Integer[]> chemicalCombinationAmounts = new ArrayList<Integer[]>();
+
+
+       /**
+        * 化合台の結果のリスト
+        */
+       private ArrayList<ItemStack> chemicalCombinationResult = new ArrayList<ItemStack>();
+
+
+       /**
+        * 素材製作台のレシピクラス
+        */
+       private ArrayList<MaterialRecipe> materialRecipe = new ArrayList<MaterialRecipe>();
+
+
+       /**
+        * ChemiCraftの化学作業台類のレシピのマネージャー
+        */
+       private ChemiCraftCraftingManager chemiCraftCraftingManager = new ChemiCraftCraftingManager();
+
+
+
+       /**
+        * add compound.
+        * @param name compound name.
+        */
+       public void addCompound(String name){
+               addLangCompound("", name, "");
+       }
+
+
+
+       /**
+        * add compound corresponding to the language.
+        * @param lang Language to the corresponding
+        * @param englishName compound name
+        * @param langName compound name(specified language)
+        */
+       public void addLangCompound(String lang, String englishName, String langName){
+               compoundsNameList.add(englishName);
+               compoundsLangNameList.add(langName);
+               compoundsLangList.add(lang);
+               compoundHash.put(englishName, compoundHash.size());
+       }
+
+
+
+       public int getCompound(String key){
+               if(compoundHash.get(key) != null){
+                       return compoundHash.get(key);
+               } else {
+                       return -1;
+               }
+       }
+
+
+
+       /**
+        * setting compound handler.
+        * @param handlerItemName
+        * @param compoundHandler
+        */
+       public void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
+               compoundHandlers.add(compoundHandler);
+               compoundHandlerItemNames.add(handlerItemName);
+       }
+
+
+
+       /**
+        * 分解レシピを追加します。resultの要素数は0<= n <= 16にしてください。
+        * @param material 素材
+        * @param result 結果
+        */
+       public void addDecompositionRecipe(ItemStack material, ItemStack[] result){
+               if(result.length <= 16){
+                       decompositionMaterial.add(material);
+                       decompositionResults.add(result);
+               }else{
+                       System.err.println("ChemiCraft内でエラー:addDecompositionRecipeの引数resultの要素数が16を超えています。" + "Material:" + material + "  Result:" + result);
+               }
+       }
+
+
+
+       /**
+        * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
+        * @param material 素材
+        * @param result 結果
+        */
+       public void addChemicalCombinationRecipe(String[] atoms, Integer[] amounts, ItemStack result){
+               chemicalCombinationAtoms.add(atoms);
+               chemicalCombinationAmounts.add(amounts);
+               chemicalCombinationResult.add(result);
+       }
+
+
+
+       public void addDecompositionRecipe(ItemStack material, int[] results, int[] stacks) {
+               ItemStack[] itemstacks = new ItemStack[results.length];
+               for (int i = 0; i < itemstacks.length; i++) {
+                       itemstacks[i] = new ItemStack(ChemiCraft.instance.atomsID,stacks[i], results[i]);
+               }
+               TileEntityPyrolysisTable.addRecipe(material, itemstacks);
+       }
+
+
+
+       public void addDecompositionRecipe(ItemStack itemstack, int burnTime) {
+               TileEntityPyrolysisTable.addFuel(itemstack, burnTime);
+       }
+
+
+
+       public void addSharplessMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
+               materialRecipe.add(new MaterialRecipe(result, materials, nbtRecipe, true));
+       }
+
+
+
+       public void addMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
+               materialRecipe.add(new MaterialRecipe(result, materials, nbtRecipe, false));
+       }
+       //以下システム関連//////////////////////////////////////////////////////
+
+       public ArrayList<ICompoundHandler> getCompoundHandler(){
+               compoundHandlers.trimToSize();
+               return compoundHandlers;
+
+       }
+
+
+
+       public ArrayList<String> getCompoundHandlerItemName(){
+               compoundHandlerItemNames.trimToSize();
+               return compoundHandlerItemNames;
+       }
+
+
+
+       public ArrayList<String> getCompoundsName(){
+               compoundsNameList.trimToSize();
+               return compoundsNameList;
+       }
+
+
+
+       public ArrayList<String> getCompoundsLangName(){
+               compoundsLangNameList.trimToSize();
+               return compoundsLangNameList;
+       }
+
+
+
+       public ArrayList<String> getCompoundsLang(){
+               compoundsLangList.trimToSize();
+               return compoundsLangList;
+       }
+
+
+
+       public ArrayList<ItemStack> getDecompositionMaterial(){
+               return decompositionMaterial;
+       }
+
+
+
+       public ArrayList<ItemStack[]> getDecompositionResult(){
+               return decompositionResults;
+       }
+
+
+
+       public ArrayList<String[]> getChemicalCombinationAtoms(){
+               return chemicalCombinationAtoms;
+       }
+
+
+
+       public ArrayList<Integer[]> getChemicalCombinationAmounts(){
+               return chemicalCombinationAmounts;
+       }
+
+
+
+       public ArrayList<ItemStack> getChemicalCombinationResult(){
+               return chemicalCombinationResult;
+       }
+
+
+
+       public ArrayList<MaterialRecipe> getMaterialRecipe(){
+               return materialRecipe;
+       }
+
+
+
+       public ChemiCraftCraftingManager getCraftingManager(){
+               return chemiCraftCraftingManager;
+       }
+
+
+
+       public static ChemiCraftAPI getInstance(){
+               return instance;
+       }
+
+}
diff --git a/common/chemicraft/ChemiCraftData.java b/common/chemicraft/ChemiCraftData.java
new file mode 100644 (file)
index 0000000..8dab814
--- /dev/null
@@ -0,0 +1,258 @@
+package chemicraft;
+
+public final class ChemiCraftData {
+
+       public static final int HYDROGEN = 0;
+       public static final int HELIUM = 1;
+       public static final int LITHIUM = 2;
+       public static final int BERYLLIUM = 3;
+       public static final int BORON = 4;
+       public static final int CARBON = 5;
+       public static final int NITROGEN = 6;
+       public static final int OXYGEN = 7;
+       public static final int FLUORINE = 8;
+       public static final int NEON = 9;
+       public static final int SODIUM = 10;
+       public static final int MAGNESIUM = 11;
+       public static final int ALMINIUM = 12;
+       public static final int SILICON = 13;
+       public static final int PHOSPHORUS = 14;
+       public static final int SULFUR = 15;
+       public static final int CHLORINE = 16;
+       public static final int ARGON = 17;
+       public static final int POTASSIUM = 18;
+       public static final int CALCIUM = 19;
+       public static final int SCANDIUM = 20;
+       public static final int TITANIUM = 21;
+       public static final int VANADIUM = 22;
+       public static final int CHROMIUM = 23;
+       public static final int MANGANESE = 24;
+       public static final int IRON = 25;
+       public static final int COBALT = 26;
+       public static final int NICKEL = 27;
+       public static final int COPPER = 28;
+       public static final int ZINC = 29;
+       public static final int GALLIUM = 30;
+       public static final int GERMANIUM = 31;
+       public static final int ARSENIC = 32;
+       public static final int SELENIUM = 33;
+       public static final int BROMINE = 34;
+       public static final int KRYPTON = 35;
+       public static final int RUBIDIUM = 36;
+       public static final int STRONTIUM = 37;
+       public static final int YTTORIUM = 38;
+       public static final int ZIRCONIUM = 39;
+       public static final int NIOBIUM = 40;
+       public static final int MOLYBDENUM = 41;
+       public static final int TECHNETIUM = 42;
+       public static final int RUTHENIUM = 43;
+       public static final int RHODIUM = 44;
+       public static final int PALLADIUM = 45;
+       public static final int SILVER = 46;
+       public static final int CADMIUM = 47;
+       public static final int INDIUM = 48;
+       public static final int TIN = 49;
+       public static final int ANTIMONY = 50;
+       public static final int TELLURIUM = 51;
+       public static final int IODINE = 52;
+       public static final int XENON = 53;
+       public static final int CAESIUM = 54;
+       public static final int BARIUM = 55;
+       public static final int LANTHANUM = 56;
+       public static final int CERIUM = 57;
+       public static final int PRASEODYMIUM = 58;
+       public static final int NEODYMIUM = 59;
+       public static final int PROMETHIUM = 60;
+       public static final int SAMARIUM = 61;
+       public static final int EUROPIUM = 62;
+       public static final int GADOLINIUM = 63;
+       public static final int TERBIUM = 64;
+       public static final int DYSPROSIUM = 65;
+       public static final int HOLMIUM = 66;
+       public static final int ERBIUM = 67;
+       public static final int THULIUM = 68;
+       public static final int YTTERBIUM = 69;
+       public static final int LUTETIUM = 70;
+       public static final int HAFNIUM = 71;
+       public static final int TANTALUM = 72;
+       public static final int TUNGSTEN = 73;
+       public static final int RHENIUM = 74;
+       public static final int OSMIUM = 75;
+       public static final int IRIDIUM = 76;
+       public static final int PLATINUM = 77;
+       public static final int GOLD = 78;
+       public static final int MERCURY = 79;
+       public static final int THALLIUM = 80;
+       public static final int LEAD = 81;
+       public static final int BISMUTH = 82;
+       public static final int POLONIUM = 83;
+       public static final int ASTATINE = 84;
+       public static final int RADON = 85;
+       public static final int FRANCIUM = 86;
+       public static final int RADIUM = 87;
+       public static final int ACTINIUM = 88;
+       public static final int THORIUM = 89;
+       public static final int PROTACTINIUM = 90;
+       public static final int URANIUM = 91;
+       public static final int NEPTUNIUM = 92;
+       public static final int PLUTONIUM = 93;
+       public static final int AMERICIUM = 94;
+       public static final int CURIUM = 95;
+       public static final int BERKELIUM = 96;
+       public static final int CALIforNIUM = 97;
+       public static final int EINSTEINIUM = 98;
+       public static final int FERMIUM = 99;
+       public static final int MENDILEVIUM = 100;
+       public static final int NOBELIUM = 101;
+       public static final int LAWRENCIUM = 102;
+       public static final int RUTHERforDIUM = 103;
+       public static final int DUBNIUM = 104;
+       public static final int SEABORGIUM = 105;
+       public static final int BOHRIUM = 106;
+       public static final int HASSIUM = 107;
+       public static final int MEITNERIUM = 108;
+       public static final int DARMSTADTIUM = 109;
+       public static final int ROENTGENIUM = 110;
+       public static final int COPERNICIUM = 111;
+       public static final int UNUNTRIUM = 112;
+       public static final int UNUNQUADIUM = 113;
+       public static final int UNUNPENTIUM = 114;
+       public static final int UNUNHEXIUM = 115;
+       public static final int UNUNSEPTIUM = 116;
+       public static final int UNUNOCTIUM = 117;
+
+       public static final String HYDROGEN_SIGN = "H";
+       public static final String HELIUM_SIGN = "He";
+       public static final String LITHIUM_SIGN = "Li";
+       public static final String BERYLLIUM_SIGN = "Be";
+       public static final String BORON_SIGN = "B";
+       public static final String CARBON_SIGN = "C";
+       public static final String NITROGEN_SIGN = "N";
+       public static final String OXYGEN_SIGN = "O";
+       public static final String FLUORINE_SIGN = "F";
+       public static final String NEON_SIGN = "Ne";
+       public static final String SODIUM_SIGN = "Na";
+       public static final String MAGNESIUM_SIGN = "Mg";
+       public static final String ALMINIUM_SIGN = "Al";
+       public static final String SILICON_SIGN = "Si";
+       public static final String PHOSPHORUS_SIGN = "P";
+       public static final String SULFUR_SIGN = "S";
+       public static final String CHLORINE_SIGN = "Cl";
+       public static final String ARGON_SIGN = "Ar";
+       public static final String POTASSIUM_SIGN = "K";
+       public static final String CALCIUM_SIGN = "Ca";
+       public static final String SCANDIUM_SIGN = "Sc";
+       public static final String TITANIUM_SIGN = "Ti";
+       public static final String VANADIUM_SIGN = "V";
+       public static final String CHROMIUM_SIGN = "Cr";
+       public static final String MANGANESE_SIGN = "Mn";
+       public static final String IRON_SIGN = "Fe";
+       public static final String COBALT_SIGN = "Co";
+       public static final String NICKEL_SIGN = "Ni";
+       public static final String COPPER_SIGN = "Cu";
+       public static final String ZINC_SIGN = "Zn";
+       public static final String GALLIUM_SIGN = "Ga";
+       public static final String GERMANIUM_SIGN = "Ge";
+       public static final String ARSENIC_SIGN = "As";
+       public static final String SELENIUM_SIGN = "Se";
+       public static final String BROMINE_SIGN = "Br";
+       public static final String KRYPTON_SIGN = "Kr";
+       public static final String RUBIDIUM_SIGN = "Rb";
+       public static final String STRONTIUM_SIGN = "Sr";
+       public static final String YTTORIUM_SIGN = "Y";
+       public static final String ZIRCONIUM_SIGN = "Zr";
+       public static final String NIOBIUM_SIGN = "Nb";
+       public static final String MOLYBDENUM_SIGN = "Mo";
+       public static final String TECHNETIUM_SIGN = "Tc";
+       public static final String RUTHENIUM_SIGN = "Ru";
+       public static final String RHODIUM_SIGN = "Rh";
+       public static final String PALLADIUM_SIGN = "Pd";
+       public static final String SILVER_SIGN = "Ag";
+       public static final String CADMIUM_SIGN = "Cd";
+       public static final String INDIUM_SIGN = "In";
+       public static final String TIN_SIGN = "Sn";
+       public static final String ANTIMONY_SIGN = "Sb";
+       public static final String TELLURIUM_SIGN = "Te";
+       public static final String IODINE_SIGN = "I";
+       public static final String XENON_SIGN = "Xe";
+       public static final String CAESIUM_SIGN = "Cs";
+       public static final String BARIUM_SIGN = "Ba";
+       public static final String LANTHANUM_SIGN = "La";
+       public static final String CERIUM_SIGN = "Ce";
+       public static final String PRASEODYMIUM_SIGN = "Pr";
+       public static final String NEODYMIUM_SIGN = "Nd";
+       public static final String PROMETHIUM_SIGN = "Pm";
+       public static final String SAMARIUM_SIGN = "Sm";
+       public static final String EUROPIUM_SIGN = "Eu";
+       public static final String GADOLINIUM_SIGN = "Gd";
+       public static final String TERBIUM_SIGN = "Tb";
+       public static final String DYSPROSIUM_SIGN = "Dy";
+       public static final String HOLMIUM_SIGN = "Ho";
+       public static final String ERBIUM_SIGN = "Er";
+       public static final String THULIUM_SIGN = "Tm";
+       public static final String YTTERBIUM_SIGN = "Yb";
+       public static final String LUTETIUM_SIGN = "Lu";
+       public static final String HAFNIUM_SIGN = "Hf";
+       public static final String TANTALUM_SIGN = "Ta";
+       public static final String TUNGSTEN_SIGN = "W";
+       public static final String RHENIUM_SIGN = "Re";
+       public static final String OSMIUM_SIGN = "Os";
+       public static final String IRIDIUM_SIGN = "Ir";
+       public static final String PLATINUM_SIGN = "Pt";
+       public static final String GOLD_SIGN = "Au";
+       public static final String MERCURY_SIGN = "Hg";
+       public static final String THALLIUM_SIGN = "Tl";
+       public static final String LEAD_SIGN = "Pb";
+       public static final String BISMUTH_SIGN = "Bi";
+       public static final String POLONIUM_SIGN = "Po";
+       public static final String ASTATINE_SIGN = "At";
+       public static final String RADON_SIGN = "Rn";
+       public static final String FRANCIUM_SIGN = "Fr";
+       public static final String RADIUM_SIGN = "Ra";
+       public static final String ACTINIUM_SIGN = "Ac";
+       public static final String THORIUM_SIGN = "Th";
+       public static final String PROTACTINIUM_SIGN = "Pa";
+       public static final String URANIUM_SIGN = "U";
+       public static final String NEPTUNIUM_SIGN = "Np";
+       public static final String PLUTONIUM_SIGN = "Pu";
+       public static final String AMERICIUM_SIGN = "Am";
+       public static final String CURIUM_SIGN = "Cm";
+       public static final String BERKELIUM_SIGN = "Bk";
+       public static final String CALIforNIUM_SIGN = "Cf";
+       public static final String EINSTEINIUM_SIGN = "Es";
+       public static final String FERMIUM_SIGN = "Fm";
+       public static final String MENDILEVIUM_SIGN = "Md";
+       public static final String NOBELIUM_SIGN = "No";
+       public static final String LAWRENCIUM_SIGN = "Lr";
+       public static final String RUTHERforDIUM_SIGN = "Rf";
+       public static final String DUBNIUM_SIGN = "Db";
+       public static final String SEABORGIUM_SIGN = "Sg";
+       public static final String BOHRIUM_SIGN = "Bh";
+       public static final String HASSIUM_SIGN = "Hs";
+       public static final String MEITNERIUM_SIGN = "Mt";
+       public static final String DARMSTADTIUM_SIGN = "Ds";
+       public static final String ROENTGENIUM_SIGN = "Rg";
+       public static final String COPERNICIUM_SIGN = "Cn";
+       public static final String UNUNTRIUM_SIGN = "Uut";
+       public static final String UNUNQUADIUM_SIGN = "Uuq";
+       public static final String UNUNPENTIUM_SIGN = "Uup";
+       public static final String UNUNHEXIUM_SIGN = "Uuh";
+       public static final String UNUNSEPTIUM_SIGN = "Uus";
+       public static final String UNUNOCTIUM_SIGN = "Uuo";
+
+       public static final String[] ATOMSLIST = {
+               "H",  "He",  "Li",  "Be",  "B",  "C",  "N",  "O",  "F",  "Ne",
+               "Na",  "Mg",  "Al",  "Si",  "P",  "S",  "Cl",  "Ar",  "K",  "Ca",
+               "Sc",  "Ti",  "V",  "Cr",  "Mn",  "Fe",  "Co",  "Ni",  "Cu",  "Zn",
+               "Ga",  "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr",
+               "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn",
+               "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Pm",
+               "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu",
+               "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl",
+               "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa",
+               "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md",
+               "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg",
+               "Cn", "Uut", "Uuq", "Uup", "Uuh", "Uus", "Uuo"
+       };
+
+}
diff --git a/common/chemicraft/block/BlockChemicalCombinationTable.java b/common/chemicraft/block/BlockChemicalCombinationTable.java
new file mode 100644 (file)
index 0000000..4562eda
--- /dev/null
@@ -0,0 +1,66 @@
+package chemicraft.block;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+
+public class BlockChemicalCombinationTable extends BlockContainer {
+
+       public BlockChemicalCombinationTable(int par1, int par2, Material par3Material) {
+               super(par1, par2, par3Material);
+               this.setCreativeTab(ChemiCraft.creativeTab);
+       }
+
+       @Override
+       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
+               par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiChemicalCombinationTableID, par1World, par2, par3, par4);
+               return true;
+       }
+
+
+
+       @Override
+       public String getTextureFile() {
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
+       }
+
+
+
+       public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
+               if (!par1World.isRemote) {
+                       boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
+                       if(var7) {
+                               TileEntityChemicalCombinationTable tileentity;
+                               try {
+                                       tileentity = (TileEntityChemicalCombinationTable) par1World.getBlockTileEntity(par2, par3, par4);
+                               } catch(ClassCastException e) {
+                                       return;
+                               }
+                               tileentity.setProvidePower(true);
+                       }
+               }
+       }
+
+
+
+       @Override
+       public int getBlockTextureFromSide(int par1) {
+               if(par1 == 0){
+                       return 17;
+               }else if(par1 == 1){
+                       return 1;
+               }else{
+                       return 16;
+               }
+       }
+
+       @Override
+       public TileEntity createNewTileEntity(World var1) {
+               return new TileEntityChemicalCombinationTable();
+       }
+
+}
diff --git a/common/chemicraft/block/BlockChemicalCraftingTable.java b/common/chemicraft/block/BlockChemicalCraftingTable.java
new file mode 100644 (file)
index 0000000..7bf1578
--- /dev/null
@@ -0,0 +1,53 @@
+package chemicraft.block;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+
+public class BlockChemicalCraftingTable extends BlockContainer {
+
+       public BlockChemicalCraftingTable(int par1, int par2, Material par3Material) {
+               super(par1, par2, par3Material);
+               this.setCreativeTab(ChemiCraft.creativeTab);
+       }
+
+
+       @Override
+       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
+               par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiChemicalCraftingTableID, par1World, par2, par3, par4);
+               return true;
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
+       }
+
+
+
+       @Override
+       public int getBlockTextureFromSide(int par1)
+       {
+               if(par1 == 0){
+                       return 17;
+               }else if(par1 == 1){
+                       return 3;
+               }else{
+                       return 16;
+               }
+       }
+
+
+
+       @Override
+       public TileEntity createNewTileEntity(World var1) {
+               return new TileEntityChemicalCraftingTable();
+       }
+
+}
diff --git a/common/chemicraft/block/BlockPyrolysisTable.java b/common/chemicraft/block/BlockPyrolysisTable.java
new file mode 100644 (file)
index 0000000..728545f
--- /dev/null
@@ -0,0 +1,65 @@
+package chemicraft.block;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.debug.DebugTick;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+
+public class BlockPyrolysisTable extends BlockContainer {
+
+       public BlockPyrolysisTable(int par1, int par2, Material par3Material) {
+               super(par1, par2, par3Material);
+               this.setCreativeTab(ChemiCraft.creativeTab);
+       }
+
+       @Override
+       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
+               par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiPyrolysisTableID, par1World, par2, par3, par4);
+               return true;
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
+       }
+
+
+
+       @Override
+       public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
+               TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);
+               if (tileentity != null) {
+                       DebugTick.removeDebugData("PyrolysisTable" +
+                                       "(x:" + tileentity.xCoord +
+                                       " y:" + tileentity.yCoord +
+                                       " z:" + tileentity.zCoord + ")");
+               }
+               super.breakBlock(par1World, par2, par3, par4, par5, par6);
+       }
+
+
+
+       @Override
+       public int getBlockTextureFromSide(int par1)
+       {
+               if(par1 == 0){
+                       return 17;
+               }else if(par1 == 1){
+                       return 0;
+               }else{
+                       return 16;
+               }
+       }
+
+       @Override
+       public TileEntity createNewTileEntity(World var1) {
+               return new TileEntityPyrolysisTable();
+       }
+
+}
diff --git a/common/chemicraft/block/BlockToolAndWeaponCraftingTable.java b/common/chemicraft/block/BlockToolAndWeaponCraftingTable.java
new file mode 100644 (file)
index 0000000..463d2da
--- /dev/null
@@ -0,0 +1,50 @@
+package chemicraft.block;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+
+public class BlockToolAndWeaponCraftingTable extends BlockContainer {
+
+       public BlockToolAndWeaponCraftingTable(int par1, int par2, Material par3Material) {
+               super(par1, par2, par3Material);
+               this.setCreativeTab(ChemiCraft.creativeTab);
+       }
+
+       @Override
+       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
+               par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiToolAndWeaponCraftingTableID, par1World, par2, par3, par4);
+               return true;
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
+       }
+
+
+
+       @Override
+       public int getBlockTextureFromSide(int par1)
+       {
+               if(par1 == 0){
+                       return 17;
+               }else if(par1 == 1){
+                       return 2;
+               }else{
+                       return 16;
+               }
+       }
+
+       @Override
+       public TileEntity createNewTileEntity(World var1) {
+               return new TileEntityToolAndWeaponCraftingTable();
+       }
+
+}
diff --git a/common/chemicraft/compounds/CompoundWater.java b/common/chemicraft/compounds/CompoundWater.java
new file mode 100644 (file)
index 0000000..a009a6c
--- /dev/null
@@ -0,0 +1,31 @@
+package chemicraft.compounds;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.util.ICompoundHandler;
+
+public class CompoundWater implements ICompoundHandler {
+
+       @Override
+       public ItemStack onItemRightClickHandler(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
+               return null;
+       }
+
+       @Override
+       public boolean onItemUseHandler(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
+               return false;
+       }
+
+       @Override
+       public void onUpdateHandler(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+
+       }
+
+       @Override
+       public int getIconIndexHandler() {
+               return 1;
+       }
+
+}
diff --git a/common/chemicraft/container/ContainerChemicalCombinationTable.java b/common/chemicraft/container/ContainerChemicalCombinationTable.java
new file mode 100644 (file)
index 0000000..2244348
--- /dev/null
@@ -0,0 +1,157 @@
+package chemicraft.container;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.ChemiCraftAPI;
+import chemicraft.inventory.InventoryChemicalCombinationTableMaterial;
+import chemicraft.inventory.InventoryChemicalCombinationTableResult;
+import chemicraft.slot.SlotChemicalCombinationTableMaterial;
+import chemicraft.slot.SlotChemicalCombinationTableResult;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import cpw.mods.fml.common.network.PacketDispatcher;
+
+public class ContainerChemicalCombinationTable extends Container {
+
+       /**
+        * the world.
+        */
+       private World worldObj;
+
+       /**
+        * the TileEntity of Position.
+        */
+       private int posX;
+       private int posY;
+       private int posZ;
+
+       /**
+        * the TileEntity.
+        */
+       private TileEntityChemicalCombinationTable tileentity;
+
+       /**
+        * the Inventory's.
+        */
+       private InventoryChemicalCombinationTableMaterial invm;
+       private InventoryChemicalCombinationTableResult invr;
+
+       /**
+        * the EntityPlayer.
+        */
+       private EntityPlayer entityplayer;
+
+       public ContainerChemicalCombinationTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCombinationTable par2) {
+               super();
+               this.entityplayer = par1EntityPlayer;
+               this.tileentity = par2;
+               this.worldObj = tileentity.worldObj;
+               this.posX = tileentity.xCoord;
+               this.posY = tileentity.yCoord;
+               this.posZ = tileentity.zCoord;
+               this.invm = this.tileentity.getInvMaterial();
+               this.invr = this.tileentity.getInvResult();
+
+               for(int i = 0;i < 5;i++){
+                       for(int j = 0;j < 3;j++){
+                               this.addSlotToContainer(new SlotChemicalCombinationTableMaterial(this.invm, i * 3 + j, i * 18 + 16, j * 18 + 15));
+                       }
+               }
+               this.addSlotToContainer(new SlotChemicalCombinationTableResult(invr, 0, 123, 34));
+
+
+               int var3;
+               for (var3 = 0; var3 < 3; ++var3)
+               {
+                       for (int var4 = 0; var4 < 9; ++var4)
+                       {
+                               this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 121 + var3 * 18));
+                       }
+               }
+
+               for (var3 = 0; var3 < 9; ++var3)
+               {
+                       this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var3, 8 + var3 * 18, 179));
+               }
+
+               this.invm.setEventHandler(this);
+               this.onCraftMatrixChanged(invm);
+       }
+
+
+
+       @Override
+       public void onCraftMatrixChanged(IInventory par1IInventory){
+               this.invr.setInventorySlotContents(0, ChemiCraftAPI.getInstance().getCraftingManager().getChemicalCombinationResult(this.tileentity.getAtomsList(), this.tileentity.getAtomsAmountList()));
+               if (par1IInventory instanceof InventoryChemicalCombinationTableResult) {
+                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
+               }
+       }
+
+       @Override
+       public boolean canInteractWith(EntityPlayer par1EntityPlayer){
+               return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.chemicalConbinationTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
+       }
+
+       @Override
+       public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
+               ItemStack var3 = null;
+               Slot var4 = (Slot)this.inventorySlots.get(par2);
+               Slot var6 = (Slot)this.inventorySlots.get(0);
+
+               if (var4 != null && var4.getHasStack()) {
+                       ItemStack var5 = var4.getStack();
+                       var3 = var5.copy();
+                       if (par2 >= 0 && par2 < 16) {
+                               if (!this.mergeItemStack(var5, 16, 52, false)) {
+                                       return null;
+                               }
+                       } else if (par2 >= 16 && par2 < 53) {
+                               if (var6.isItemValid(var3)) {
+                                       if (!this.mergeItemStack(var5, 0, 15, false)) {
+                                               return null;
+                                       }
+                               }
+                       } else if(par2 == 16) {
+                               if (!this.mergeItemStack(var5, 16, 52, false)) {
+                                       return null;
+                               }
+                       }
+
+                       if (var5.stackSize == 0) {
+                               var4.putStack((ItemStack)null);
+                       } else {
+                               var4.onSlotChanged();
+                       }
+
+                       if (var5.stackSize == var3.stackSize) {
+                               return null;
+                       }
+
+                       var4.onPickupFromSlot(par1EntityPlayer, var5);
+               }
+
+               return var3;
+       }
+
+       @Override
+       public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) {
+               if (par1 == 15) {
+                       if (this.invr.getStackInSlot(0) != null) {
+                               this.tileentity.emptytoAtomsList();
+                       }
+               }
+               return super.slotClick(par1, par2, par3, par4EntityPlayer);
+       }
+
+       @Override
+       public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
+               super.onCraftGuiClosed(par1EntityPlayer);
+       }
+
+}
diff --git a/common/chemicraft/container/ContainerChemicalCraftingTable.java b/common/chemicraft/container/ContainerChemicalCraftingTable.java
new file mode 100644 (file)
index 0000000..017066f
--- /dev/null
@@ -0,0 +1,153 @@
+package chemicraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.ChemiCraftAPI;
+import chemicraft.inventory.InventoryChemicalCraftingMaterial;
+import chemicraft.inventory.InventoryChemicalCraftingNBT;
+import chemicraft.inventory.InventoryChemicalCraftingResult;
+import chemicraft.slot.SlotChemicalCraftingTableResult;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.util.ChemicalNBTRecipe;
+
+public class ContainerChemicalCraftingTable extends Container {
+
+       /**
+        * Worldのインスタンス
+        */
+       private World worldObj;
+
+
+       /**
+        * BlockのX, Y, Z座標
+        */
+       private int posX;
+       private int posY;
+       private int posZ;
+
+
+       /**
+        * the TileEntity.
+        */
+       private TileEntityChemicalCraftingTable tileEntity;
+
+
+       private InventoryChemicalCraftingMaterial invm;
+       private InventoryChemicalCraftingResult invr;
+       private InventoryChemicalCraftingNBT invn;
+
+       private ChemicalNBTRecipe useNBT;
+
+
+
+       public ContainerChemicalCraftingTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCraftingTable par2)
+       {
+               super();
+               this.worldObj = par2.worldObj;
+               this.posX = par2.xCoord;
+               this.posY = par2.yCoord;
+               this.posZ = par2.zCoord;
+               this.tileEntity = par2;
+               this.invm = (InventoryChemicalCraftingMaterial) this.tileEntity.chemicalCraftingInvMaterial;
+               this.invr = (InventoryChemicalCraftingResult) this.tileEntity.chemicalCraftingInvResult;
+               this.invn = (InventoryChemicalCraftingNBT) this.tileEntity.chemicalCraftingInvNBT;
+               //GenerateInventory
+               this.generateSlots(this.invm, this.invr, this.invn);
+               //GeneratePlayerInventory
+               int var3;
+
+               for (var3 = 0; var3 < 3; ++var3)
+               {
+                       for (int var4 = 0; var4 < 9; ++var4)
+                       {
+                               this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 85 + var3 * 18));
+                       }
+               }
+
+               for (var3 = 0; var3 < 9; ++var3)
+               {
+                       this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var3, 8 + var3 * 18, 143));
+               }
+
+               this.invm.setEventHandler(this);
+               this.invr.setEventHandler(this);
+               this.invn.setEventHandler(this);
+               this.onCraftMatrixChanged(invm);
+       }
+
+
+
+       @Override
+       public void onCraftMatrixChanged(IInventory par1IInventory){
+               this.useNBT = ChemiCraftAPI.getInstance().getCraftingManager().chemicalCrafting(this.invm, this.invr, this.invn);
+       }
+
+       @Override
+       public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
+               super.onCraftGuiClosed(par1EntityPlayer);
+       }
+
+       @Override
+       public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer)
+       {
+               if(par1 == 12){
+                       if(this.invr.getStackInSlot(0) == null) return super.slotClick(par1, par2, par3, par4EntityPlayer);
+                       ItemStack var1 = par4EntityPlayer.inventory.getItemStack();
+                       if(var1 != null){
+                               if(var1.stackSize + this.invr.getStackInSlot(0).stackSize >= var1.getMaxStackSize()) return super.slotClick(par1, par2, par3, par4EntityPlayer);
+                       }
+                       for(int i = 0;i < this.invm.getSizeInventory();i++){
+                               if(this.invm.getStackInSlot(i) != null){
+                                       if(this.invm.getStackInSlot(i).stackSize > 1){
+                                               this.invm.getStackInSlot(i).stackSize--;
+                                       }else{
+                                               this.invm.setInventorySlotContents(i, null);
+                                       }
+                               }
+                       }
+                       ItemStack[] matchNBT = new ItemStack[this.invn.getSizeInventory()];
+                       for(int i = 0;i < this.invn.getSizeInventory();i++){
+                               matchNBT[i] = this.invn.getStackInSlot(i);
+                       }
+                       if(this.useNBT == null) return super.slotClick(par1, par2, par3, par4EntityPlayer);
+                       ItemStack[] useItems = this.useNBT.getMatchItems(matchNBT);
+                       for(int i = 0;i < useItems.length;i++){
+                               if(useItems[i] != null){
+                                       this.invn.setInventorySlotContents(i, null);
+                               }
+                       }
+               }
+               return super.slotClick(par1, par2, par3, par4EntityPlayer);
+       }
+
+       @Override
+       public boolean canInteractWith(EntityPlayer par1EntityPlayer){
+               return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.chemicalCraftingTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
+       }
+
+
+
+       @Override
+       public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2){
+               return null;
+       }
+
+
+
+       private void generateSlots(IInventory materialInv, IInventory resultInv, IInventory nbtInv){
+               for(int i = 0;i < 3;i++){
+                       this.addSlotToContainer(new Slot(invn, i, 30 + 18 * i, 7));
+               }
+               for(int i = 0;i < 3;i++){
+                       for(int j = 0;j < 3;j++){
+                               this.addSlotToContainer(new Slot(invm, i * 3 + j, 30 + 18 * j, 27 + 18 * i));
+                       }
+               }
+               this.addSlotToContainer(new SlotChemicalCraftingTableResult(invr, 0, 123, 33));
+       }
+}
diff --git a/common/chemicraft/container/ContainerPyrolysisTable.java b/common/chemicraft/container/ContainerPyrolysisTable.java
new file mode 100644 (file)
index 0000000..83477d0
--- /dev/null
@@ -0,0 +1,59 @@
+package chemicraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.slot.SlotPyrolysisTableFuel;
+import chemicraft.slot.SlotPyrolysisTableMaterial;
+import chemicraft.slot.SlotPyrolysisTableResult;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+
+public class ContainerPyrolysisTable extends Container {
+
+       private World worldObj;
+
+       private int posX;
+       private int posY;
+       private int posZ;
+
+       private TileEntityPyrolysisTable tileentity;
+
+       public ContainerPyrolysisTable(EntityPlayer par1EntityPlayer, TileEntityPyrolysisTable par2){
+               super();
+               this.tileentity = par2;
+               this.worldObj = par2.worldObj;
+               this.posX = par2.xCoord;
+               this.posY = par2.yCoord;
+               this.posZ = par2.zCoord;
+
+               for (int i = 0; i < 4; i++) {
+                       for (int j = 0; j < 4; j++) {
+                               this.addSlotToContainer(new SlotPyrolysisTableResult(this.tileentity.getInvResult(), i*4 + j, 88+i*18, 17+j*18));
+                       }
+               }
+               this.addSlotToContainer(new SlotPyrolysisTableMaterial(this.tileentity.getInvMaterial(), 0, 27, 20));
+               this.addSlotToContainer(new SlotPyrolysisTableFuel(this.tileentity.getInvFuel(), 0, 27, 63));
+
+               int var3;
+               for (var3 = 0; var3 < 3; ++var3)
+               {
+                       for (int var4 = 0; var4 < 9; ++var4)
+                       {
+                               this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 121 + var3 * 18));
+                       }
+               }
+
+               for (var3 = 0; var3 < 9; ++var3)
+               {
+                       this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var3, 8 + var3 * 18, 179));
+               }
+       }
+
+       @Override
+       public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
+               return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.pyrolysisTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
+       }
+
+}
diff --git a/common/chemicraft/container/ContainerToolAndWeaponCraftingTable.java b/common/chemicraft/container/ContainerToolAndWeaponCraftingTable.java
new file mode 100644 (file)
index 0000000..acadb79
--- /dev/null
@@ -0,0 +1,18 @@
+package chemicraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+
+public class ContainerToolAndWeaponCraftingTable extends Container {
+
+       public ContainerToolAndWeaponCraftingTable(EntityPlayer par1EntityPlayer, TileEntityToolAndWeaponCraftingTable par2){
+               super();
+       }
+
+       @Override
+       public boolean canInteractWith(EntityPlayer var1) {
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/debug/CommandDeleteItem.java b/common/chemicraft/debug/CommandDeleteItem.java
new file mode 100644 (file)
index 0000000..50fa3d6
--- /dev/null
@@ -0,0 +1,64 @@
+package chemicraft.debug;
+
+import java.util.Iterator;
+import java.util.List;
+
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.world.World;
+
+public class CommandDeleteItem extends CommandBase {
+
+       @Override
+       public String getCommandName() {
+               return "delItem";
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public void processCommand(ICommandSender var1, String[] var2) {
+               MinecraftServer server = null;
+               EntityPlayerMP player = null;
+               try { server = (MinecraftServer)var1; } catch (ClassCastException e) {}
+               try{ player = (EntityPlayerMP)var1;} catch(ClassCastException e) {}
+
+               World world;
+               List<Entity> list;
+               Iterator<Entity> itr;
+
+               if(server != null){
+                       if(var2.length > 0){
+                               world = server.worldServerForDimension(Integer.parseInt(var2[0]));
+                               list = world.loadedEntityList;
+                               itr = list.iterator();
+                               while(itr.hasNext()){
+                                       Entity entity = itr.next();
+                                       if(entity instanceof EntityItem){
+                                               entity.setDead();
+                                       }
+                               }
+                       }else{
+                               var1.sendChatToPlayer("Please specify the World.");
+                       }
+               }else if(player != null){
+                       world = player.worldObj;
+                       list = world.loadedEntityList;
+                       itr = list.iterator();
+                       player.dimension = 128;
+                       while(itr.hasNext()){
+                               Entity entity = itr.next();
+                               if(entity instanceof EntityItem){
+                                       entity.setDead();
+                               }
+                       }
+               }else{
+                       var1.sendChatToPlayer("---Command Error---");
+               }
+
+       }
+
+}
diff --git a/common/chemicraft/debug/CommandGenDebugRoom.java b/common/chemicraft/debug/CommandGenDebugRoom.java
new file mode 100644 (file)
index 0000000..1d95976
--- /dev/null
@@ -0,0 +1,28 @@
+package chemicraft.debug;
+
+import net.minecraft.block.Block;
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+public class CommandGenDebugRoom extends CommandBase {
+
+       @Override
+       public String getCommandName() {
+               return "debugRoom";
+       }
+
+       @Override
+       public void processCommand(ICommandSender var1, String[] var2) {
+               try{
+                       EntityPlayer player = (EntityPlayer)var1;
+                       World wolrd = player.worldObj;
+
+                       SetBlockSupport.box(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Block.bedrock.blockID, 0, 20, 20, 6);
+               }catch(ClassCastException e){
+
+               }
+       }
+
+}
diff --git a/common/chemicraft/debug/CommandSetTile.java b/common/chemicraft/debug/CommandSetTile.java
new file mode 100644 (file)
index 0000000..6f649fa
--- /dev/null
@@ -0,0 +1,45 @@
+package chemicraft.debug;
+
+import net.minecraft.block.Block;
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+public class CommandSetTile extends CommandBase {
+
+       @Override
+       public String getCommandName() {
+               return "setTile";
+       }
+
+       @Override
+       public void processCommand(ICommandSender var1, String[] var2) {
+               try{
+                       EntityPlayer player = (EntityPlayer)var1;
+                       World wolrd = player.worldObj;
+                       if(var2.length > 0){
+                               try{
+                                       if(Integer.parseInt(var2[0]) < 4096 && Block.blocksList[Integer.parseInt(var2[0])] != null || Integer.parseInt(var2[0]) == 0){
+                                               if(var2.length == 1){
+                                                       SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), Integer.parseInt(var2[1]), 12, 12);
+                                               }else if(var2.length > 2){
+                                                       SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), Integer.parseInt(var2[1]), Integer.parseInt(var2[2]), Integer.parseInt(var2[2]));
+                                               }else{
+                                                       SetBlockSupport.square(wolrd, (int)player.posX, (int)player.posY, (int)player.posZ, Integer.parseInt(var2[0]), 0, 12, 12);
+                                               }
+                                       }else{
+                                               var1.sendChatToPlayer("\u00a7cBlockが存在しないか指定された数が4096を超えています。");
+                                       }
+                               }catch(NumberFormatException e){
+                                       var1.sendChatToPlayer("\u00a7c指定された文字は数値ではありません。");
+                               }
+                       }else{
+                               var1.sendChatToPlayer("\u00a7cBlockIDを指定してください。(Metadata, Sizeも可能)");
+                       }
+               }catch(ClassCastException e){
+
+               }
+       }
+
+}
diff --git a/common/chemicraft/debug/CompoundHandlerTest.java b/common/chemicraft/debug/CompoundHandlerTest.java
new file mode 100644 (file)
index 0000000..3dbe818
--- /dev/null
@@ -0,0 +1,37 @@
+package chemicraft.debug;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.util.ICompoundHandler;
+
+public class CompoundHandlerTest implements ICompoundHandler {
+
+       @Override
+       public ItemStack onItemRightClickHandler(ItemStack par1ItemStack, World par2World,
+                       EntityPlayer par3EntityPlayer) {
+               System.out.println("onRightClick");
+               return par1ItemStack;
+       }
+
+       @Override
+       public boolean onItemUseHandler(ItemStack par1ItemStack,
+                       EntityPlayer par2EntityPlayer, World par3World, int par4, int par5,
+                       int par6, int par7, float par8, float par9, float par10) {
+               System.out.println("onItemUse");
+               return true;
+       }
+
+       @Override
+       public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
+                       Entity par3Entity, int par4, boolean par5) {
+               System.out.println("onUpdate");
+       }
+
+       @Override
+       public int getIconIndexHandler() {
+               return 0;
+       }
+
+}
diff --git a/common/chemicraft/debug/DebugData.java b/common/chemicraft/debug/DebugData.java
new file mode 100644 (file)
index 0000000..7af7876
--- /dev/null
@@ -0,0 +1,21 @@
+package chemicraft.debug;
+
+public class DebugData {
+
+       private String key;
+       private Object value;
+
+       public DebugData(String par1, Object par2) {
+               this.key = par1;
+               this.value = par2;
+       }
+
+       public String getKey() {
+               return this.key;
+       }
+
+       public Object getValue() {
+               return this.value;
+       }
+
+}
diff --git a/common/chemicraft/debug/DebugTick.java b/common/chemicraft/debug/DebugTick.java
new file mode 100644 (file)
index 0000000..e168e75
--- /dev/null
@@ -0,0 +1,89 @@
+package chemicraft.debug;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+
+import cpw.mods.fml.common.ITickHandler;
+import cpw.mods.fml.common.TickType;
+
+public class DebugTick extends JPanel implements ITickHandler {
+
+       private static HashMap<String, DebugData[]> displayDataList = new HashMap<String, DebugData[]>();
+
+       public DebugTick() {
+               JFrame frame = new JFrame();
+               frame.setSize(640, 480);
+               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+               frame.add(this);
+               frame.setVisible(true);
+
+       }
+
+       @Override
+       public void tickStart(EnumSet<TickType> type, Object... tickData) {
+
+       }
+
+       @Override
+       public void tickEnd(EnumSet<TickType> type, Object... tickData) {
+               this.repaint();
+       }
+
+       @Override
+       public EnumSet<TickType> ticks() {
+               return EnumSet.of(TickType.GUI, TickType.CLIENT);
+       }
+
+       @Override
+       public String getLabel() {
+               return null;
+       }
+
+       @Override
+       public void paintComponent(Graphics g) {
+               Graphics2D g2 = (Graphics2D) g;
+
+               g2.clearRect(0, 0, this.getWidth(), this.getHeight());
+
+               int fontPos = 20;
+               Iterator<String> itKey = displayDataList.keySet().iterator();
+               while (itKey.hasNext()) {
+                       String key = itKey.next();
+                       DebugData[] datas = displayDataList.get(key);
+                       g2.setFont(new Font("MS ゴシック", Font.BOLD, 16));
+                       g2.setColor(Color.RED);
+                       g2.drawString(key + ":", 10, fontPos);
+                       g2.setFont(new Font("MS ゴシック", Font.PLAIN, 12));
+                       g2.setColor(Color.BLACK);
+
+                       fontPos += 16;
+
+                       for (int i = 0; i < datas.length; i++) {
+                               g2.drawString(String.valueOf(datas[i].getKey()) + ":" + String.valueOf(datas[i].getValue()), 10, fontPos);
+                               fontPos += 12;
+                       }
+
+                       fontPos += 4;
+
+               }
+       }
+
+       public static void setDebugData(String key, DebugData... value) {
+               displayDataList.put(key, value);
+       }
+
+       public static void removeDebugData(String key) {
+               displayDataList.remove(key);
+       }
+
+}
diff --git a/common/chemicraft/debug/SetBlockSupport.java b/common/chemicraft/debug/SetBlockSupport.java
new file mode 100644 (file)
index 0000000..2663d5d
--- /dev/null
@@ -0,0 +1,596 @@
+package chemicraft.debug;
+import java.util.Random;
+
+import net.minecraft.world.World;
+
+public class SetBlockSupport
+{
+
+       static Random rand = new Random();
+
+       /**
+        * X方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param Length 長さ
+        * @param Direction 方向(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object lineX(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)
+       {
+               int loop2=0;
+               Object DataBox=null;
+               for(loop2=0;loop2 < Length;loop2++)
+               {
+                       switch(Direction)
+                       {
+                       default:
+
+                       case -1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z, Block, meta);
+                               break;
+                       case 0:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X-(Length-1)+loop2,Y,Z,Block,meta);
+                               break;
+                       case 1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X+loop2, Y, Z, Block,meta);
+                               break;
+                       }
+               }
+               return DataBox;
+       }
+
+       /**
+        * Y方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param Length 長さ
+        * @param Direction 方向(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object lineY(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)
+       {
+               int loop2=0;
+               Object DataBox=null;
+               for(loop2=0;loop2 < Length;loop2++)
+               {
+                       switch(Direction)
+                       {
+                       default:
+
+                       case -1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y-loop2, Z, Block,meta);
+                               break;
+                       case 0:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X,Y-(Length-1)+loop2,Z,Block,meta);
+                               break;
+                       case 1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y+loop2, Z, Block,meta);
+                               break;
+                       }
+               }
+               return DataBox;
+       }
+
+       /**
+        * Z方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param Length 長さ
+        * @param Direction 方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object lineZ(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int Direction)
+       {
+               int loop2=0;
+               Object DataBox=null;
+               for(loop2=0;loop2 < Length;loop2++)
+               {
+                       switch(Direction)
+                       {
+                       default:
+
+                       case -1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z-loop2, Block,meta);
+                               break;
+                       case 0:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X,Y,Z-(Length-1)+loop2,Block,meta);
+                               break;
+                       case 1:
+                               DataBox = par1World.setBlockAndMetadataWithNotify(X, Y, Z+loop2, Block,meta);
+                               break;
+                       }
+               }
+               return DataBox;
+       }
+
+       /**
+        * XY方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param XLength X方向の長さ
+        * @param YLength Y方向の長さ
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object  lineXY(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int YLength,int XDirection,int YDirection)
+       {
+               Object DataBox=null;
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);
+               DataBox = lineY(par1World,X,Y,Z,Block,YLength,meta,YDirection);
+               return DataBox;
+       }
+
+       /**
+        * XZ方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param XLength X方向の長さ
+        * @param ZLength Y方向の長さ
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object  lineXZ(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int ZLength,int XDirection,int ZDirection)
+       {
+               Object DataBox=null;
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);
+               return DataBox;
+       }
+
+       /**
+        * YZ方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param YLength X方向の長さ
+        * @param ZLength Y方向の長さ
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object  lineYZ(World par1World,int X,int Y,int Z,int Block,int meta,int YLength,int ZLength,int YDirection,int ZDirection)
+       {
+               Object DataBox=null;
+               DataBox = lineY(par1World,X,Y,Z,Block,meta,YLength,YDirection);
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);
+               return DataBox;
+       }
+
+       /**
+        * XYZ方向に線状にBlockを配置します。
+        * Directionが0の場合、特殊な計算式で
+        * +,-方向:loop-1の長さになります。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param XLength X方向の長さ
+        * @param YLength Y方向の長さ
+        * @param ZLength Z方向の長さ
+        * @param XDirection X方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @param YDirection Y方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @param ZDirection Z方向指定(+方向:1,-方向:-1,中心から-+の方向:0)
+        * @return Object
+        */
+       public static Object  lineXYZ(World par1World,int X,int Y,int Z,int Block,int meta,int XLength,int YLength,int ZLength,int XDirection,int YDirection,int ZDirection)
+       {
+               Object DataBox=null;
+               DataBox = lineX(par1World,X,Y,Z,Block,meta,XLength,XDirection);
+               DataBox = lineY(par1World,X,Y,Z,Block,meta,YLength,YDirection);
+               DataBox = lineZ(par1World,X,Y,Z,Block,meta,ZLength,ZDirection);
+               return DataBox;
+       }
+
+       /**
+        * X方向の壁を作成します。
+        * Directionは1で固定です。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param Length 幅
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object wallX(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int height)
+       {
+               Object DataBox = null;
+               for(int loop = 0;loop < Length;loop++){
+                       lineY(par1World, X - (Length/2) + loop, Y, Z, Block,meta, height, 1);
+               }
+               return DataBox;
+       }
+
+       /**
+        * Z方向の壁を作成します。
+        * Directionは1で固定です。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param Length 幅
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object wallZ(World par1World,int X,int Y,int Z,int Block,int meta,int Length,int height)
+       {
+               Object DataBox = null;
+               for(int loop = 0;loop < Length;loop++){
+                       lineY(par1World, X, Y, Z - (Length/2) + loop, Block,meta, height, 1);
+               }
+               return DataBox;
+       }
+
+       /**
+        * 辺だけの四角を作成します。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param LengthX X方向の長さ
+        * @param LengthZ  Z方向の長さ
+        * @return Object
+        */
+       public static Object spuareFrame(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ)
+       {
+               Object DataBox = null;
+               DataBox = lineX(par1World, X, Y, Z + (LengthZ/2), Block,meta, LengthX/2+1, 0);
+               DataBox = lineX(par1World, X, Y, Z - (LengthZ/2), Block,meta, LengthX/2+1, 0);
+               DataBox = lineZ(par1World, X + (LengthX/2), Y, Z, Block,meta, LengthZ/2+1, 0);
+               DataBox = lineZ(par1World, X - (LengthX/2), Y, Z, Block,meta, LengthZ/2+1, 0);
+               return DataBox;
+       }
+
+       /**
+        * 辺だけの箱を作成します。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param LengthX X方向の長さ
+        * @param LengthZ  Z方向の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object boxFrame(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)
+       {
+               Object DataBox=null;
+               DataBox = lineX(par1World, X, Y, Z + (LengthZ/2), Block,meta, LengthX/2, 0);
+               DataBox = lineX(par1World, X, Y, Z - (LengthZ/2), Block,meta, LengthX/2, 0);
+               DataBox = lineX(par1World, X, Y + height-1, Z + (LengthZ/2), Block,meta, LengthX/2, 0);
+               DataBox = lineX(par1World, X, Y + height-1, Z - (LengthZ/2), Block,meta, LengthX/2, 0);
+
+               DataBox = lineY(par1World,X +(LengthX/2),Y,Z +(LengthZ/2),Block,meta,height,1);
+               DataBox = lineY(par1World,X -(LengthX/2),Y,Z +(LengthZ/2),Block,meta,height,1);
+               DataBox = lineY(par1World,X +(LengthX/2),Y,Z - (LengthZ/2),Block,meta,height,1);
+               DataBox = lineY(par1World,X -(LengthX/2),Y,Z - (LengthZ/2),Block,meta,height,1);
+
+               DataBox = lineZ(par1World, X + (LengthX/2), Y, Z, Block,meta, LengthZ/2, 0);
+               DataBox = lineZ(par1World, X - (LengthX/2), Y, Z, Block,meta, LengthZ/2, 0);
+               DataBox = lineZ(par1World, X + (LengthX/2), Y + height-1, Z, Block,meta, LengthZ/2, 0);
+               DataBox = lineZ(par1World, X - (LengthX/2), Y + height-1, Z, Block,meta, LengthZ/2, 0);
+               return DataBox;
+       }
+
+       /**
+        * 四角を作成します。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param LengthX X方向の長さ
+        * @param LengthZ  Z方向の長さ
+        * @return Object
+        */
+       public static Object square(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ)
+       {
+               Object DataBox = null;
+               int loop1 = 0;
+               for(loop1=0; loop1 < LengthZ; loop1++){
+                       DataBox = lineX(par1World,X - (LengthX/2),Y,Z - (LengthZ/2) + loop1,Block,meta,LengthX,1);
+               }
+               return DataBox;
+       }
+
+       /**
+        * 箱を生成します。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param LengthX X方向の長さ
+        * @param LengthZ  Z方向の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object box(World par1World,int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)
+       {
+               Object DataBox = null;
+               DataBox = square(par1World, X, Y, Z, Block, meta,LengthX,LengthZ);
+               DataBox = square(par1World,X,Y+height,Z,Block,meta,LengthX,LengthZ);
+               DataBox = wallX(par1World,X,Y,Z-(LengthZ/2),Block,meta,LengthX,height);
+               DataBox = wallZ(par1World,X-(LengthX/2),Y,Z,Block,meta,LengthZ,height);
+               DataBox = wallX(par1World,X,Y,Z+(LengthZ/2),Block,meta,LengthX,height);
+               DataBox = wallZ(par1World,X+(LengthX/2),Y,Z,Block,meta,LengthZ,height);
+               return DataBox;
+       }
+
+       /**
+        * Blockで埋め尽くされた箱を生成します。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param LengthX X方向の長さ
+        * @param LengthZ  Z方向の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object fillBox(World par1World , int X,int Y,int Z,int Block,int meta,int LengthX,int LengthZ,int height)
+       {
+               Object DataBox = null;
+               DataBox = square(par1World, X, Y, Z, Block,meta, LengthX,LengthZ);
+               DataBox = square(par1World,X,Y+height,Z,Block,meta,LengthX,LengthZ);
+               DataBox = wallX(par1World,X,Y,Z-(LengthZ/2),Block,meta,LengthX,height);
+               DataBox = wallZ(par1World,X-(LengthX/2),Y,Z,Block,meta,LengthZ,height);
+               DataBox = wallX(par1World,X,Y,Z+(LengthZ/2),Block,meta,LengthX,height);
+               DataBox = wallZ(par1World,X+(LengthX/2),Y,Z,Block,meta,LengthZ,height);
+
+               for(int i = 0; i < LengthX - 1; i++)
+               {
+                       DataBox = wallZ(par1World,X + 1 - LengthX / 2 + i, Y , Z , Block ,meta,LengthZ, height);
+               }
+
+               return DataBox;
+       }
+
+       /**
+        * 座標ごとにデータを指定して配置します。
+        * 配列になっているので、順番に指定してください。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param XPosition 配置する相対X座標
+        * @param YPosition 配置する相対Y座標
+        * @param ZPosition 配置する相対Z座標
+        * @param Option
+        * @return Object
+        */
+       public static Object fineSetBlock(World par1World,int X,int Y,int Z,int[] Block,int[] meta,int[] XPosition,int[] YPosition,int[] ZPosition,Object[] Option){
+               Object DataBox = null;
+               for(int i=0;i<Block.length;i++){
+                       DataBox = par1World.setBlockAndMetadata(X+XPosition[i], Y+YPosition[i], Z+ZPosition[i], Block[i],meta[i]);
+               }
+
+               if(Option!=null){
+                       for(int j=0;j<Option.length;j++){
+                               DataBox = Option[j];
+                       }
+               }
+               return DataBox;
+       }
+
+       /**
+        * X方向に台形を作成します。
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param upperSide 上辺の長さ
+        * @param bottomSide 下辺の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object trapezoidX(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){
+               Object dataBox = null;
+               int Rate=0;
+               int Math=0;
+               int XRate=0;
+               int YRate = 0;
+               for(int i=0;i<height;i++){
+                       YRate++;
+                       Math++;
+                       XRate++;
+                       if(upperSide < bottomSide){
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){
+                                       Rate++;
+                                       Math=0;
+                               }
+                       }
+
+                       if(bottomSide < upperSide){
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){
+                                       Rate--;
+                                       Math=0;
+                               }
+                       }
+
+                       dataBox=lineZ(par1World, X+XRate-1, Y+YRate, Z, Block, meta, upperSide+Rate, 0);
+               }
+               return dataBox;
+       }
+
+       /**
+        * Y方向のXラインに台形を作成します。
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param upperSide 上辺の長さ
+        * @param bottomSide 下辺の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object trapezoidY_X(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){
+               Object dataBox = null;
+               int Rate=0;
+               int Math=0;
+               int YRate = 0;
+               for(int i=0;i<height;i++){
+                       YRate++;
+                       Math++;
+                       if(upperSide < bottomSide){
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){
+                                       Rate++;
+                                       Math=0;
+                               }
+                       }
+
+                       if(bottomSide < upperSide){
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){
+                                       Rate--;
+                                       Math=0;
+                               }
+                       }
+
+                       dataBox=lineZ(par1World, X, Y+YRate, Z, Block, meta, upperSide+Rate, 0);
+               }
+               return dataBox;
+       }
+
+       /**
+        * Y方向のZラインに台形を作成します。
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param upperSide 上辺の長さ
+        * @param bottomSide 下辺の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object trapezoidY_Z(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){
+               Object dataBox = null;
+               int Rate=0;
+               int Math=0;
+               int YRate = 0;
+               for(int i=0;i<height;i++){
+                       YRate++;
+                       Math++;
+                       if(upperSide < bottomSide){
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){
+                                       Rate++;
+                                       Math=0;
+                               }
+                       }
+
+                       if(bottomSide < upperSide){
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){
+                                       Rate--;
+                                       Math=0;
+                               }
+                       }
+
+                       dataBox=lineX(par1World, X, Y+YRate, Z, Block, meta, upperSide+Rate, 0);
+               }
+               return dataBox;
+       }
+
+       /**
+        * Z方向に台形を作成します。
+        * 必ずbottom/(upper*3)*(height/upper)かupper/(bottom*3)*(height/buttom)が整数になるようにしてください。
+        * @param par1World
+        * @param X 基準X座標
+        * @param Y 基準Y座標
+        * @param Z 基準Z座標
+        * @param Block 配置するBlock
+        * @param meta 配置するMetadata
+        * @param upperSide 上辺の長さ
+        * @param bottomSide 下辺の長さ
+        * @param height 高さ
+        * @return Object
+        */
+       public static Object TrapezoidZ(World par1World,int X,int Y,int Z,int Block,int meta,int upperSide,int bottomSide,int height){
+               Object dataBox = null;
+               int Rate=0;
+               int Math=0;
+               int ZRate=0;
+               for(int i=0;i<height;i++){
+                       Math++;
+                       ZRate++;
+                       if(upperSide < bottomSide){
+                               if(Math == bottomSide/(upperSide*3)*(height/upperSide)){
+                                       Rate++;
+                                       Math=0;
+                               }
+                       }
+
+                       if(bottomSide < upperSide){
+                               if(Math == upperSide/(bottomSide*3)*(height/bottomSide)){
+                                       Rate--;
+                                       Math=0;
+                               }
+                       }
+
+                       dataBox=lineX(par1World, X, Y, Z+ZRate, Block, meta, upperSide+Rate, 0);
+               }
+               return dataBox;
+       }
+
+}
\ No newline at end of file
diff --git a/common/chemicraft/entity/EntityAtomsGrenade.java b/common/chemicraft/entity/EntityAtomsGrenade.java
new file mode 100644 (file)
index 0000000..deb72b1
--- /dev/null
@@ -0,0 +1,75 @@
+package chemicraft.entity;
+
+import java.util.Iterator;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.projectile.EntityThrowable;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+
+public class EntityAtomsGrenade extends EntityThrowable
+{
+
+       private float explodeSize;
+       private boolean isExplode;
+       private boolean onFire;
+       private boolean isNuke;
+
+       public EntityAtomsGrenade(World par1World, EntityLiving par2EntityLiving, boolean par3, boolean par4, boolean par5) {
+               super(par1World, par2EntityLiving);
+               this.isExplode = par3;
+               this.onFire = par4;
+               this.isNuke = par5;
+       }
+
+       @Override
+       public void onUpdate(){
+               super.onUpdate();
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
+       {
+
+               if(isExplode){
+                       this.explodeSize = 3.0F;
+               }
+
+               if(isNuke){
+                       this.explodeSize = 20.0F;
+               }
+
+               if (par1MovingObjectPosition.entityHit != null) {
+                       par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.func_85052_h()), 2);
+                       par1MovingObjectPosition.entityHit.setFire(5);
+               }
+
+               if (!this.worldObj.isRemote && !isNuke) {
+                       this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, explodeSize, onFire);
+                       this.isDead = true;
+               }else if(!this.worldObj.isRemote && isNuke){
+                       this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, explodeSize, onFire);
+                       Iterator<EntityLiving> itr = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, this.boundingBox.expand(30, 30, 30)).iterator();
+                       while(itr.hasNext()){
+                               EntityLiving entity = itr.next();
+                               double dx = Math.abs(entity.posX - this.posX);
+                               double dy = Math.abs(entity.posY - this.posY);
+                               double dz = Math.abs(entity.posZ - this.posZ);
+                               int distance = (int)Math.sqrt( Math.pow(dx, 2) + Math.pow(dy, 2) + Math.pow(dz, 2) );
+                               if(30 - distance >= 0){
+                                       entity.addPotionEffect(new PotionEffect(2, (60 + (30 - distance)) * 20, (30 - distance) / 5));
+                                       entity.addPotionEffect(new PotionEffect(4, (60 + (30 - distance)) * 20, (30 - distance) / 5));
+                                       entity.addPotionEffect(new PotionEffect(18, (60 + (30 - distance)) * 20, (30 - distance) / 5));
+                                       entity.addPotionEffect(new PotionEffect(19, (60 + (30 - distance)) * 20, (30 - distance) / 5));
+                               }
+                       }
+                       this.isDead = true;
+               }
+
+       }
+
+}
diff --git a/common/chemicraft/gui/GuiChemicalCombinationTable.java b/common/chemicraft/gui/GuiChemicalCombinationTable.java
new file mode 100644 (file)
index 0000000..7daf181
--- /dev/null
@@ -0,0 +1,58 @@
+package chemicraft.gui;
+
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.gui.GuiTextField;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import chemicraft.ChemiCraft;
+import chemicraft.container.ContainerChemicalCombinationTable;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import cpw.mods.fml.common.network.PacketDispatcher;
+
+public class GuiChemicalCombinationTable extends GuiContainer {
+
+       private GuiTextField atomList;
+
+       private TileEntityChemicalCombinationTable tileentity;
+
+       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, 9, 103, 160, 15);
+               this.atomList.setFocused(false);
+               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
+       protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCombinationTexture));
+               this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
+       }
+
+       @Override
+       protected void actionPerformed(GuiButton par1GuiButton) {
+               if(par1GuiButton.id == 0){
+                       this.tileentity.field_00001();
+                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
+               }else if(par1GuiButton.id == 1){
+                       this.tileentity.field_00002();
+                       PacketDispatcher.sendPacketToServer(this.tileentity.getDescriptionPacket());
+               }
+               return;
+       }
+
+       @Override
+       protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+               this.atomList.setText(this.tileentity.getAtoms());
+               this.atomList.drawTextBox();
+       }
+
+}
diff --git a/common/chemicraft/gui/GuiChemicalCraftingTable.java b/common/chemicraft/gui/GuiChemicalCraftingTable.java
new file mode 100644 (file)
index 0000000..a25ad96
--- /dev/null
@@ -0,0 +1,26 @@
+package chemicraft.gui;
+
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import chemicraft.ChemiCraft;
+import chemicraft.container.ContainerChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class GuiChemicalCraftingTable extends GuiContainer {
+
+       public GuiChemicalCraftingTable(EntityPlayer par1EntityPlayer, TileEntityChemicalCraftingTable par2){
+               super(new ContainerChemicalCraftingTable(par1EntityPlayer, par2));
+       }
+
+
+
+       @Override
+       protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3){
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCraftingTexture));
+               this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
+       }
+
+}
diff --git a/common/chemicraft/gui/GuiPyrolysisTable.java b/common/chemicraft/gui/GuiPyrolysisTable.java
new file mode 100644 (file)
index 0000000..903740c
--- /dev/null
@@ -0,0 +1,30 @@
+package chemicraft.gui;
+
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import chemicraft.ChemiCraft;
+import chemicraft.container.ContainerPyrolysisTable;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+
+public class GuiPyrolysisTable extends GuiContainer{
+
+       private TileEntityPyrolysisTable tileentity;
+
+       public GuiPyrolysisTable(EntityPlayer par1EntityPlayer, TileEntityPyrolysisTable par2) {
+               super(new ContainerPyrolysisTable(par1EntityPlayer, par2));
+               this.tileentity = par2;
+               this.ySize = 204;
+       }
+
+       @Override
+       protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiPyrolysisTexture));
+               this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
+       }
+
+       @Override
+       protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+               this.fontRenderer.drawString(String.valueOf("Temp:" + (int)this.tileentity.getHeat()), 110, 100, 0x000000);
+       }
+
+}
diff --git a/common/chemicraft/gui/GuiToolAndWeaponCraftingTable.java b/common/chemicraft/gui/GuiToolAndWeaponCraftingTable.java
new file mode 100644 (file)
index 0000000..d3e9288
--- /dev/null
@@ -0,0 +1,22 @@
+package chemicraft.gui;
+
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import chemicraft.ChemiCraft;
+import chemicraft.container.ContainerToolAndWeaponCraftingTable;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+
+public class GuiToolAndWeaponCraftingTable extends GuiContainer {
+
+       public GuiToolAndWeaponCraftingTable(EntityPlayer par1EntityPlayer, TileEntityToolAndWeaponCraftingTable par2) {
+               super(new ContainerToolAndWeaponCraftingTable(par1EntityPlayer, par2));
+       }
+
+       @Override
+       protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiToolAndWeaponCraftingTexture));
+               this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
+       }
+
+
+}
diff --git a/common/chemicraft/inventory/InventoryChemicalCombinationTableMaterial.java b/common/chemicraft/inventory/InventoryChemicalCombinationTableMaterial.java
new file mode 100644 (file)
index 0000000..42f2f05
--- /dev/null
@@ -0,0 +1,113 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCombinationTableMaterial implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[16];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCombinationTableMaterial";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryChemicalCombinationTableResult.java b/common/chemicraft/inventory/InventoryChemicalCombinationTableResult.java
new file mode 100644 (file)
index 0000000..a6edc74
--- /dev/null
@@ -0,0 +1,114 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCombinationTableResult implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[15];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCombinationTableResult";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+
+}
diff --git a/common/chemicraft/inventory/InventoryChemicalCraftingMaterial.java b/common/chemicraft/inventory/InventoryChemicalCraftingMaterial.java
new file mode 100644 (file)
index 0000000..6bd7c4b
--- /dev/null
@@ -0,0 +1,93 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCraftingMaterial implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[9];
+
+       private Container eventHandelr;
+
+       public void setEventHandler(Container par1Container){
+               this.eventHandelr = par1Container;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int par1, int par2)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var3 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var3;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int par1)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var2 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               inventory[var1] = var2;
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCraftingInventory";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               this.eventHandelr.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+
+       }
+
+       @Override
+       public void closeChest() {
+
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryChemicalCraftingNBT.java b/common/chemicraft/inventory/InventoryChemicalCraftingNBT.java
new file mode 100644 (file)
index 0000000..f57eb68
--- /dev/null
@@ -0,0 +1,93 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCraftingNBT implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[3];
+
+       private Container eventHandelr;
+
+       public void setEventHandler(Container par1Container){
+               this.eventHandelr = par1Container;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int par1, int par2)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var3 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var3;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int par1)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var2 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               inventory[var1] = var2;
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCraftingInventory";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               this.eventHandelr.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+
+       }
+
+       @Override
+       public void closeChest() {
+
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryChemicalCraftingResult.java b/common/chemicraft/inventory/InventoryChemicalCraftingResult.java
new file mode 100644 (file)
index 0000000..1c6aa6e
--- /dev/null
@@ -0,0 +1,94 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryChemicalCraftingResult implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[1];
+
+       private Container eventHandelr;
+
+       public void setEventHandler(Container par1Container){
+               this.eventHandelr = par1Container;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int par1, int par2)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var3 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var3;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int par1)
+       {
+               if (this.inventory[par1] != null)
+               {
+                       ItemStack var2 = this.inventory[par1];
+                       this.inventory[par1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               inventory[var1] = var2;
+       }
+
+       @Override
+       public String getInvName() {
+               return "ChemicalCraftingInventory";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               this.eventHandelr.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+
+       }
+
+       @Override
+       public void closeChest() {
+
+       }
+
+
+}
diff --git a/common/chemicraft/inventory/InventoryPyrolysisTableFuel.java b/common/chemicraft/inventory/InventoryPyrolysisTableFuel.java
new file mode 100644 (file)
index 0000000..1f4c5be
--- /dev/null
@@ -0,0 +1,112 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryPyrolysisTableFuel implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[1];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "PyrolysisTableFuel";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+}
diff --git a/common/chemicraft/inventory/InventoryPyrolysisTableMaterial.java b/common/chemicraft/inventory/InventoryPyrolysisTableMaterial.java
new file mode 100644 (file)
index 0000000..ada8aa4
--- /dev/null
@@ -0,0 +1,113 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryPyrolysisTableMaterial implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[1];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "PyrolysisTableMaterial";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryPyrolysisTableResult.java b/common/chemicraft/inventory/InventoryPyrolysisTableResult.java
new file mode 100644 (file)
index 0000000..f8ca9fd
--- /dev/null
@@ -0,0 +1,112 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryPyrolysisTableResult implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[16];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "PyrolysisTableResult";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableMaterial.java b/common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableMaterial.java
new file mode 100644 (file)
index 0000000..aad5063
--- /dev/null
@@ -0,0 +1,113 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryToolAndWeaponCraftingTableMaterial implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[16];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "ToolAndWeaponCraftingTableMaterial";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+}
diff --git a/common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableResult.java b/common/chemicraft/inventory/InventoryToolAndWeaponCraftingTableResult.java
new file mode 100644 (file)
index 0000000..b6743a7
--- /dev/null
@@ -0,0 +1,114 @@
+package chemicraft.inventory;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class InventoryToolAndWeaponCraftingTableResult implements IInventory {
+
+       private ItemStack[] inventory = new ItemStack[16];
+       private Container eventHandler;
+
+       public void setEventHandler(Container par1){
+               this.eventHandler = par1;
+       }
+
+       @Override
+       public int getSizeInventory() {
+               return this.inventory.length;
+       }
+
+       @Override
+       public ItemStack getStackInSlot(int var1) {
+               return this.inventory[var1];
+       }
+
+       @Override
+       public ItemStack decrStackSize(int var1, int var2) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var3;
+
+                       if (this.inventory[var1].stackSize <= var2)
+                       {
+                               var3 = this.inventory[var1];
+                               this.inventory[var1] = null;
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+                       else
+                       {
+                               var3 = this.inventory[var1].splitStack(var2);
+
+                               if (this.inventory[var1].stackSize == 0)
+                               {
+                                       this.inventory[var1] = null;
+                               }
+
+                               this.onInventoryChanged();
+                               return var3;
+                       }
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public ItemStack getStackInSlotOnClosing(int var1) {
+               if (this.inventory[var1] != null)
+               {
+                       ItemStack var2 = this.inventory[var1];
+                       this.inventory[var1] = null;
+                       return var2;
+               }
+               else
+               {
+                       return null;
+               }
+       }
+
+       @Override
+       public void setInventorySlotContents(int var1, ItemStack var2) {
+               this.inventory[var1] = var2;
+
+               if (var2 != null && var2.stackSize > this.getInventoryStackLimit())
+               {
+                       var2.stackSize = this.getInventoryStackLimit();
+               }
+
+               this.onInventoryChanged();
+       }
+
+       @Override
+       public String getInvName() {
+               return "ToolAndWeaponCraftingTableResult";
+       }
+
+       @Override
+       public int getInventoryStackLimit() {
+               return 64;
+       }
+
+       @Override
+       public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
+       }
+
+       @Override
+       public boolean isUseableByPlayer(EntityPlayer var1) {
+               return true;
+       }
+
+       @Override
+       public void openChest() {
+       }
+
+       @Override
+       public void closeChest() {
+       }
+
+
+}
diff --git a/common/chemicraft/item/ItemAtomInfoContainer.java b/common/chemicraft/item/ItemAtomInfoContainer.java
new file mode 100644 (file)
index 0000000..b5aec03
--- /dev/null
@@ -0,0 +1,19 @@
+package chemicraft.item;
+
+import net.minecraft.item.Item;
+import chemicraft.util.AtomInfo;
+
+public class ItemAtomInfoContainer extends Item {
+
+       /**
+        * AtonInfoのインスタンス
+        */
+       public AtomInfo atomInfo = new AtomInfo();
+
+
+
+       public ItemAtomInfoContainer(int par1){
+               super(par1);
+       }
+
+}
diff --git a/common/chemicraft/item/ItemAtoms.java b/common/chemicraft/item/ItemAtoms.java
new file mode 100644 (file)
index 0000000..b766426
--- /dev/null
@@ -0,0 +1,57 @@
+package chemicraft.item;
+
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import chemicraft.ChemiCraft;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemAtoms extends Item {
+
+       public ItemAtoms(int par1){
+               super(par1);
+               this.maxStackSize = 64;
+               this.setHasSubtypes(true);
+               this.setMaxDamage(0);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+       }
+
+
+
+       @SuppressWarnings({ "unchecked", "rawtypes" })
+       @SideOnly(Side.CLIENT)
+       @Override
+       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
+               for(int type = 0; type < ChemiCraft.instance.ATOMSNAME.length; type++)
+               {
+                       par3List.add(new ItemStack(par1, 1, type));
+                       this.setIconIndex(type);
+               }
+       }
+
+
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack){
+               return super.getItemName() + "." + ChemiCraft.instance.ATOMSNAME[par1ItemStack.getItemDamage()];
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.itemAtomsTexture;
+       }
+
+
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       public int getIconFromDamage(int par1){
+               return par1;
+       }
+
+}
\ No newline at end of file
diff --git a/common/chemicraft/item/ItemAtomsGrenade.java b/common/chemicraft/item/ItemAtomsGrenade.java
new file mode 100644 (file)
index 0000000..8d33bec
--- /dev/null
@@ -0,0 +1,79 @@
+package chemicraft.item;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.world.World;
+import chemicraft.entity.EntityAtomsGrenade;
+
+public class ItemAtomsGrenade extends Item {
+
+       public ItemAtomsGrenade(int par1) {
+               super(par1);
+       }
+
+       @Override
+       public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
+               if(par1ItemStack.stackSize <= 0){
+                       return null;
+               }
+
+               boolean var1 = false;
+               boolean var2 = false;
+               boolean var3 = false;
+
+               if(par1ItemStack.stackTagCompound != null){
+                       NBTTagList var4 = par1ItemStack.getTagCompound().getTagList("Effect");
+
+                       for(int i = 0;i < 3;i++){
+                               if(!((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("")){
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Hydrogen")){
+                                               var1 = true;
+                                       }
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Carbon")){
+                                               var2 = true;
+                                       }
+                                       if(((NBTTagCompound)var4.tagAt(0)).getString("GrenadeEffect" + i).equals("Uranium")){
+                                               var3 = true;
+                                       }
+                               }
+                       }
+               }
+               EntityAtomsGrenade entity = new EntityAtomsGrenade(par2World, par3EntityPlayer, var1, var2, var3);
+               par2World.spawnEntityInWorld(entity);
+               par1ItemStack.stackSize--;
+               return par1ItemStack;
+       }
+
+       @Override
+       public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
+               ItemStack var2 = new ItemStack(this);
+               if(par1ItemStack.hasTagCompound()){
+                       NBTTagList var1 = par1ItemStack.getTagCompound().getTagList("Effect");
+
+                       for(int i = 0;i < 3;i++){
+                               if(!((NBTTagCompound)var1.tagAt(0)).getString("GrenadeEffect" + i).equals("")){
+                                       par3List.add(
+                                                       ((NBTTagCompound)var1.tagAt(0)).getString("GrenadeEffect" + i)
+                                                       );
+                               }
+                       }
+               }
+       }
+
+       @Override
+       public boolean getShareTag()
+       {
+               return true;
+       }
+
+       @Override
+       public String getTextureFile(){
+               return "/chemicraft/items/items.png";
+       }
+
+}
diff --git a/common/chemicraft/item/ItemCompounds.java b/common/chemicraft/item/ItemCompounds.java
new file mode 100644 (file)
index 0000000..18df605
--- /dev/null
@@ -0,0 +1,98 @@
+package chemicraft.item;
+
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.ChemiCraftAPI;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemCompounds extends Item {
+
+       public ItemCompounds(int par1){
+               super(par1);
+               this.setHasSubtypes(true);
+               this.setMaxDamage(0);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+       }
+
+       @Override
+       public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
+               for(int i=0;i < ChemiCraftAPI.getInstance().getCompoundHandlerItemName().size();i++){
+                       if(ChemiCraftAPI.getInstance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.getInstance().getCompoundHandlerItemName().get(i))){
+                               return ChemiCraftAPI.getInstance().getCompoundHandler().get(i).onItemUseHandler(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
+                       }
+               }
+               return false;
+       }
+
+
+       @Override
+       public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
+       {
+               for(int i=0;i < ChemiCraftAPI.getInstance().getCompoundHandlerItemName().size();i++){
+                       if(ChemiCraftAPI.getInstance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.getInstance().getCompoundHandlerItemName().get(i))){
+                               ChemiCraftAPI.getInstance().getCompoundHandler().get(i).onItemRightClickHandler(par1ItemStack, par2World, par3EntityPlayer);
+                       }
+               }
+               return par1ItemStack;
+       }
+
+
+
+       @Override
+       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
+               for(int i=0;i < ChemiCraftAPI.getInstance().getCompoundHandlerItemName().size();i++){
+                       if(ChemiCraftAPI.getInstance().getCompoundsName().get(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.getInstance().getCompoundHandlerItemName().get(i))){
+                               ChemiCraftAPI.getInstance().getCompoundHandler().get(i).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
+                       }
+               }
+       }
+
+
+
+       @SuppressWarnings({ "unchecked", "rawtypes" })
+       @SideOnly(Side.CLIENT)
+       @Override
+       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
+               for(int type = 0; type < ChemiCraftAPI.getInstance().getCompoundsName().toArray().length; type++)
+               {
+                       par3List.add(new ItemStack(par1, 1, type));
+                       this.setIconIndex(type);
+               }
+       }
+
+
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack){
+               return super.getItemName() + "." + ChemiCraftAPI.getInstance().getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.itemCompoundsTexture;
+       }
+
+
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       public int getIconFromDamage(int par1){
+               for(int i=0;i < ChemiCraftAPI.getInstance().getCompoundHandlerItemName().size();i++){
+                       if(ChemiCraftAPI.getInstance().getCompoundsName().get(par1).equals(ChemiCraftAPI.getInstance().getCompoundHandlerItemName().get(i))){
+                               return ChemiCraftAPI.getInstance().getCompoundHandler().get(i).getIconIndexHandler();
+                       }
+               }
+               return 0;
+       }
+
+}
diff --git a/common/chemicraft/item/ItemGasCollectingBottle.java b/common/chemicraft/item/ItemGasCollectingBottle.java
new file mode 100644 (file)
index 0000000..2547632
--- /dev/null
@@ -0,0 +1,102 @@
+package chemicraft.item;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFire;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.ChemiCraftAPI;
+import chemicraft.util.MathHelperPlus;
+
+public class ItemGasCollectingBottle extends ItemAtomInfoContainer
+{
+
+       public ItemGasCollectingBottle(int id) {
+               super(id);
+               this.setMaxStackSize(1);
+               this.setMaxDamage(2);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+       }
+
+       @Override
+       public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
+       {
+               par1ItemStack.damageItem(1, par3EntityPlayer);
+
+               this.atomInfo.update(par2World, par3EntityPlayer);
+
+               int heightValue = par2World.getHeightValue((int) par3EntityPlayer.posX, (int) par3EntityPlayer.posZ);
+
+               int result1 = MathHelperPlus.probability(99, 1);
+               int result2 = MathHelperPlus.probability(78, 21, 1);
+               int result3 = MathHelperPlus.probability(0.032, 0.0018, 0.000012, 0.00052);
+               if (this.atomInfo.isOverY(heightValue)) {
+                       if (result1 == 0) {
+                               if (result2 == 0) {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 6), par3EntityPlayer);
+                               } else if (result2 == 1) {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 7), par3EntityPlayer);
+                               } else {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par3EntityPlayer);
+                               }
+                       } else {
+                               if (result3 == 0) {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par3EntityPlayer);
+                               } else if (result3 == 1) {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 9), par3EntityPlayer);
+                               } else if (result3 == 2) {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, 1), par3EntityPlayer);
+                               } else {
+                                       this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 1), par3EntityPlayer);
+                               }
+                       }
+               }
+
+               // デバッグ用
+               if (par2World.isRemote) {
+                       par3EntityPlayer.addChatMessage("result1=" + result1 + " result2=" + result2 + " result3=" + result3);
+               }
+
+               return par1ItemStack;
+       }
+
+       protected void isStackOrDrop(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer)
+       {
+               if (!par2EntityPlayer.inventory.addItemStackToInventory(par1ItemStack)) {
+                       par2EntityPlayer.dropPlayerItem(par1ItemStack);
+               }
+       }
+
+       @Override
+       public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
+       {
+               int blockID = par3World.getBlockId(par4, par5, par6);
+               Block block = Block.blocksList[blockID];
+
+               int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
+               Block uniqueBlock = Block.blocksList[uniqueBlockID];
+
+               if (uniqueBlock instanceof BlockFire){
+                       par1ItemStack.damageItem(1, par2EntityPlayer);
+
+                       int result1 = MathHelperPlus.probability(99, 1);
+
+                       if (result1 == 0) {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par2EntityPlayer);
+                       } else {
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonMonoxide")), par2EntityPlayer);
+                       }
+
+                       return true;
+               }
+               return false;
+       }
+
+       @Override
+       public String getTextureFile()
+       {
+               return "/chemicraft/items/items.png";
+       }
+
+}
diff --git a/common/chemicraft/render/RenderAtomsGrenade.java b/common/chemicraft/render/RenderAtomsGrenade.java
new file mode 100644 (file)
index 0000000..916a86f
--- /dev/null
@@ -0,0 +1,60 @@
+package chemicraft.render;
+
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.Render;
+import net.minecraft.entity.Entity;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import chemicraft.ChemiCraft;
+import chemicraft.entity.EntityAtomsGrenade;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class RenderAtomsGrenade extends Render {
+
+       private float field_77002_a;
+
+       public RenderAtomsGrenade(float par1)
+       {
+               this.field_77002_a = par1;
+       }
+
+       public void doRenderAtomsGrenade(EntityAtomsGrenade par1AtomGrenade, double par2, double par4, double par6, float par8, float par9)
+       {
+               GL11.glPushMatrix();
+               GL11.glTranslatef((float)par2, (float)par4, (float)par6);
+               GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+               float var10 = this.field_77002_a;
+               GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
+               byte var11 = 1;
+               this.loadTexture(ChemiCraft.instance.itemTexture);
+               Tessellator var12 = Tessellator.instance;
+               float var13 = (float)(var11 % 16 * 16 + 0) / 256.0F;
+               float var14 = (float)(var11 % 16 * 16 + 16) / 256.0F;
+               float var15 = (float)(var11 / 16 * 16 + 0) / 256.0F;
+               float var16 = (float)(var11 / 16 * 16 + 16) / 256.0F;
+               float var17 = 1.0F;
+               float var18 = 0.5F;
+               float var19 = 0.25F;
+               GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+               GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
+               var12.startDrawingQuads();
+               var12.setNormal(0.0F, 1.0F, 0.0F);
+               var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
+               var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
+               var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
+               var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
+               var12.draw();
+               GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+               GL11.glPopMatrix();
+       }
+
+       @Override
+       public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
+       {
+               this.doRenderAtomsGrenade((EntityAtomsGrenade)par1Entity, par2, par4, par6, par8, par9);
+       }
+}
diff --git a/common/chemicraft/slot/SlotChemicalCombinationTableMaterial.java b/common/chemicraft/slot/SlotChemicalCombinationTableMaterial.java
new file mode 100644 (file)
index 0000000..288775d
--- /dev/null
@@ -0,0 +1,22 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import chemicraft.ChemiCraft;
+
+public class SlotChemicalCombinationTableMaterial extends Slot {
+
+       public SlotChemicalCombinationTableMaterial(IInventory par1iInventory, int par2, int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack){
+               if(par1ItemStack.itemID == ChemiCraft.instance.atomsID + 256){
+                       return true;
+               }
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotChemicalCombinationTableResult.java b/common/chemicraft/slot/SlotChemicalCombinationTableResult.java
new file mode 100644 (file)
index 0000000..52a1837
--- /dev/null
@@ -0,0 +1,18 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotChemicalCombinationTableResult extends Slot {
+
+       public SlotChemicalCombinationTableResult(IInventory par1iInventory, int par2, int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack){
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotChemicalCraftingTableResult.java b/common/chemicraft/slot/SlotChemicalCraftingTableResult.java
new file mode 100644 (file)
index 0000000..1611868
--- /dev/null
@@ -0,0 +1,19 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotChemicalCraftingTableResult extends Slot {
+
+       public SlotChemicalCraftingTableResult(IInventory par1iInventory, int par2, int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack)
+       {
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotPyrolysisTableFuel.java b/common/chemicraft/slot/SlotPyrolysisTableFuel.java
new file mode 100644 (file)
index 0000000..a2ab846
--- /dev/null
@@ -0,0 +1,12 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+
+public class SlotPyrolysisTableFuel extends Slot {
+
+       public SlotPyrolysisTableFuel(IInventory par1IInventory, int par2, int par3, int par4) {
+               super(par1IInventory, par2, par3, par4);
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotPyrolysisTableMaterial.java b/common/chemicraft/slot/SlotPyrolysisTableMaterial.java
new file mode 100644 (file)
index 0000000..0d9ae9a
--- /dev/null
@@ -0,0 +1,12 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+
+public class SlotPyrolysisTableMaterial extends Slot {
+
+       public SlotPyrolysisTableMaterial(IInventory par1iInventory, int par2, int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotPyrolysisTableResult.java b/common/chemicraft/slot/SlotPyrolysisTableResult.java
new file mode 100644 (file)
index 0000000..29412ea
--- /dev/null
@@ -0,0 +1,18 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotPyrolysisTableResult extends Slot {
+
+       public SlotPyrolysisTableResult(IInventory par1iInventory, int par2,    int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack){
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/slot/SlotToolAndWeaponCraftingTableResult.java b/common/chemicraft/slot/SlotToolAndWeaponCraftingTableResult.java
new file mode 100644 (file)
index 0000000..a49b5f3
--- /dev/null
@@ -0,0 +1,18 @@
+package chemicraft.slot;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotToolAndWeaponCraftingTableResult extends Slot {
+
+       public SlotToolAndWeaponCraftingTableResult(IInventory par1iInventory, int par2, int par3, int par4) {
+               super(par1iInventory, par2, par3, par4);
+       }
+
+       @Override
+       public boolean isItemValid(ItemStack par1ItemStack){
+               return false;
+       }
+
+}
diff --git a/common/chemicraft/system/ChemiCraftCraftingManager.java b/common/chemicraft/system/ChemiCraftCraftingManager.java
new file mode 100644 (file)
index 0000000..48d177d
--- /dev/null
@@ -0,0 +1,87 @@
+package chemicraft.system;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import chemicraft.ChemiCraftAPI;
+import chemicraft.inventory.InventoryChemicalCraftingMaterial;
+import chemicraft.inventory.InventoryChemicalCraftingNBT;
+import chemicraft.inventory.InventoryChemicalCraftingResult;
+import chemicraft.util.ChemicalNBTRecipe;
+import chemicraft.util.ComparatorFormulaPart;
+import chemicraft.util.FormulaPart;
+
+public class ChemiCraftCraftingManager {
+
+       public ItemStack[] getDecompositionResults(IInventory par1IInventory){
+               return null;
+       }
+
+
+
+       public ItemStack getChemicalCombinationResult(ArrayList<String> atomsList, ArrayList<Integer> atomsAmountList){
+               ChemiCraftAPI api = ChemiCraftAPI.getInstance();
+               recipeSize :
+                       for (int i = 0; i < api.getChemicalCombinationAtoms().size(); i++) {
+                               FormulaPart[] var1 = new FormulaPart[atomsList.size()];
+                               FormulaPart[] var2 = new FormulaPart[api.getChemicalCombinationAtoms().get(i).length];
+                               for (int j = 0; j < atomsList.size(); j++) {
+                                       var1[j] = new FormulaPart(atomsList.get(j), atomsAmountList.get(j));
+                               }
+                               for (int j = 0; j < api.getChemicalCombinationAtoms().get(i).length; j++) {
+                                       var2[j] = new FormulaPart(api.getChemicalCombinationAtoms().get(i)[j], api.getChemicalCombinationAmounts().get(i)[j]);
+                               }
+                               Arrays.sort(var1, new ComparatorFormulaPart());
+                               Arrays.sort(var2, new ComparatorFormulaPart());
+                               if (var1.length != var2.length) {
+                                       continue recipeSize;
+                               }
+                               for (int j = 0; j < var1.length; j++) {
+                                       if (!var1[j].equals(var2[j])) {
+                                               continue recipeSize;
+                                       }
+                               }
+                               return api.getChemicalCombinationResult().get(i);
+                       }
+               return null;
+       }
+
+
+
+       public ChemicalNBTRecipe chemicalCrafting(InventoryChemicalCraftingMaterial par1IInventory, InventoryChemicalCraftingResult par2IInventory, InventoryChemicalCraftingNBT par3IInventory){
+               ChemiCraftAPI api = ChemiCraftAPI.getInstance();
+               ChemicalNBTRecipe returnObj = null;
+               for(int i = 0;i < api.getMaterialRecipe().size();i++){
+                       ItemStack result = api.getMaterialRecipe().get(i).match(par1IInventory);
+                       ItemStack resultArg = null;
+                       if(result != null){
+                               resultArg = new ItemStack(result.itemID, result.stackSize, result.getItemDamage());
+                               if(api.getMaterialRecipe().get(i).nbtMatch(par1IInventory) != null){
+                                       ItemStack[] nbtInv = new ItemStack[par3IInventory.getSizeInventory()];
+                                       for(int j = 0;j < par3IInventory.getSizeInventory();j++){
+                                               nbtInv[j] = par3IInventory.getStackInSlot(j);
+                                       }
+                                       api.getMaterialRecipe().get(i).nbtMatch(par1IInventory).setNBT(nbtInv, resultArg);
+                               }
+                               returnObj = api.getMaterialRecipe().get(i).nbtMatch(par1IInventory);
+                       }
+                       par2IInventory.setInventorySlotContents(0, resultArg);
+               }
+               return returnObj;
+       }
+
+
+
+       private void clearResults(IInventory par1IInventory, int par2){
+               /*
+                * Commented by mozipi.
+               ((InventoryDecomposition)par1IInventory).setFlag(false);
+                */
+               for(int i = 0;i < par2;i++){
+                       par1IInventory.setInventorySlotContents(i, null);
+               }
+       }
+
+}
diff --git a/common/chemicraft/system/CommonProxy.java b/common/chemicraft/system/CommonProxy.java
new file mode 100644 (file)
index 0000000..58f4c0a
--- /dev/null
@@ -0,0 +1,61 @@
+package chemicraft.system;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.container.ContainerChemicalCombinationTable;
+import chemicraft.container.ContainerChemicalCraftingTable;
+import chemicraft.container.ContainerPyrolysisTable;
+import chemicraft.container.ContainerToolAndWeaponCraftingTable;
+import chemicraft.debug.DebugTick;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.registry.TickRegistry;
+import cpw.mods.fml.relauncher.Side;
+
+public class CommonProxy implements IGuiHandler {
+
+       public void registerTextures(){
+
+       }
+
+       public void registerRenderInformation() {
+       }
+
+
+       @Override
+       public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+               if (!world.blockExists(x, y, z))
+                       return null;
+
+               TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
+               if (tileEntity instanceof TileEntityPyrolysisTable) {
+                       return new ContainerPyrolysisTable(player, (TileEntityPyrolysisTable) tileEntity);
+               }else if(tileEntity instanceof TileEntityChemicalCombinationTable){
+                       return new ContainerChemicalCombinationTable(player, (TileEntityChemicalCombinationTable) tileEntity);
+               }else if(tileEntity instanceof TileEntityToolAndWeaponCraftingTable){
+                       return new ContainerToolAndWeaponCraftingTable(player, (TileEntityToolAndWeaponCraftingTable) tileEntity);
+               }else if(tileEntity instanceof TileEntityChemicalCraftingTable){
+                       return new ContainerChemicalCraftingTable(player, (TileEntityChemicalCraftingTable) tileEntity);
+               }
+               return null;
+       }
+
+
+       @Override
+       public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+               return null;
+       }
+
+       public World getClientWorld(){
+               return null;
+       }
+
+       public void registerTickHandler() {
+               TickRegistry.registerTickHandler(new DebugTick(), Side.SERVER);
+       }
+
+}
\ No newline at end of file
diff --git a/common/chemicraft/system/PacketHandler.java b/common/chemicraft/system/PacketHandler.java
new file mode 100644 (file)
index 0000000..b7c7b1a
--- /dev/null
@@ -0,0 +1,196 @@
+package chemicraft.system;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.network.INetworkManager;
+import net.minecraft.network.packet.Packet;
+import net.minecraft.network.packet.Packet250CustomPayload;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import chemicraft.ChemiCraft;
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityPyrolysisTable;
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
+
+import com.google.common.io.ByteArrayDataInput;
+import com.google.common.io.ByteStreams;
+
+import cpw.mods.fml.common.network.IPacketHandler;
+import cpw.mods.fml.common.network.Player;
+
+/**
+ * サーバーとクライアントのデータの同期に必要なクラス
+ *
+ * @author Lilly
+ *
+ */
+public class PacketHandler implements IPacketHandler {
+
+       @Override
+       public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
+               if (packet.channel.equals("chemicraft")) {
+                       ByteArrayDataInput badi = ByteStreams.newDataInput(packet.data);
+
+                       World worldClient;
+                       World worldServer;
+                       TileEntity var1;
+
+                       // TileEntityのx, y, z座標
+                       int x, y, z;
+
+                       // 座標読み込み
+                       x = badi.readInt();
+                       y = badi.readInt();
+                       z = badi.readInt();
+
+                       worldClient = ChemiCraft.proxy.getClientWorld();
+                       worldServer = ((EntityPlayer)player).worldObj;
+                       if(worldClient != null && worldServer == null){
+                               var1 = worldClient.getBlockTileEntity(x, y, z);
+                               if(var1 instanceof TileEntityChemicalCombinationTable) ((TileEntityChemicalCombinationTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityChemicalCraftingTable) ((TileEntityChemicalCraftingTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityPyrolysisTable) ((TileEntityPyrolysisTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityToolAndWeaponCraftingTable) ((TileEntityToolAndWeaponCraftingTable)var1).readPacket(badi);
+                               return;
+                       }
+                       if(worldServer != null){
+                               var1 = worldServer.getBlockTileEntity(x, y, z);
+                               if(var1 instanceof TileEntityChemicalCombinationTable) ((TileEntityChemicalCombinationTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityChemicalCraftingTable) ((TileEntityChemicalCraftingTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityPyrolysisTable) ((TileEntityPyrolysisTable)var1).readPacket(badi);
+                               if(var1 instanceof TileEntityToolAndWeaponCraftingTable) ((TileEntityToolAndWeaponCraftingTable)var1).readPacket(badi);
+                       }
+                       return;
+               }
+       }
+
+
+       public static Packet getPacket(TileEntityPyrolysisTable tileEntity) {
+               ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
+               DataOutputStream var2 = new DataOutputStream(var1);
+
+               // Blockのx, y, z座標
+               int x, y, z;
+
+               // x, y, z座標を代入
+               x = tileEntity.xCoord;
+               y = tileEntity.yCoord;
+               z = tileEntity.zCoord;
+
+               try {
+                       // 座標書き込み
+                       var2.writeInt(x);
+                       var2.writeInt(y);
+                       var2.writeInt(z);
+                       tileEntity.writePacket(var2);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               // パケットの作成
+               Packet250CustomPayload packet = new Packet250CustomPayload();
+               packet.channel = "chemicraft";
+               packet.data = var1.toByteArray();
+               packet.length = var1.size();
+               packet.isChunkDataPacket = true;
+               return packet;
+       }
+
+       public static Packet getPacket(TileEntityChemicalCombinationTable tileEntity) {
+               ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
+               DataOutputStream var2 = new DataOutputStream(var1);
+
+               // Blockのx, y, z座標
+               int x, y, z;
+
+               // x, y, z座標を代入
+               x = tileEntity.xCoord;
+               y = tileEntity.yCoord;
+               z = tileEntity.zCoord;
+
+               try {
+                       // 座標書き込み
+                       var2.writeInt(x);
+                       var2.writeInt(y);
+                       var2.writeInt(z);
+                       tileEntity.writePacket(var2);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               // パケットの作成
+               Packet250CustomPayload packet = new Packet250CustomPayload();
+               packet.channel = "chemicraft";
+               packet.data = var1.toByteArray();
+               packet.length = var1.size();
+               packet.isChunkDataPacket = true;
+               return packet;
+       }
+
+       public static Packet getPacket(TileEntityToolAndWeaponCraftingTable tileEntity) {
+               ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
+               DataOutputStream var2 = new DataOutputStream(var1);
+
+               // Blockのx, y, z座標
+               int x, y, z;
+
+               // x, y, z座標を代入
+               x = tileEntity.xCoord;
+               y = tileEntity.yCoord;
+               z = tileEntity.zCoord;
+
+               try {
+                       // 座標書き込み
+                       var2.writeInt(x);
+                       var2.writeInt(y);
+                       var2.writeInt(z);
+                       tileEntity.writePacket(var2);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               // パケットの作成
+               Packet250CustomPayload packet = new Packet250CustomPayload();
+               packet.channel = "chemicraft";
+               packet.data = var1.toByteArray();
+               packet.length = var1.size();
+               packet.isChunkDataPacket = true;
+               return packet;
+       }
+
+       public static Packet getPacket(TileEntityChemicalCraftingTable tileEntity) {
+               ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
+               DataOutputStream var2 = new DataOutputStream(var1);
+
+               // Blockのx, y, z座標
+               int x, y, z;
+
+               // x, y, z座標を代入
+               x = tileEntity.xCoord;
+               y = tileEntity.yCoord;
+               z = tileEntity.zCoord;
+
+               try {
+                       // 座標書き込み
+                       var2.writeInt(x);
+                       var2.writeInt(y);
+                       var2.writeInt(z);
+                       tileEntity.writePacket(var2);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               // パケットの作成
+               Packet250CustomPayload packet = new Packet250CustomPayload();
+               packet.channel = "chemicraft";
+               packet.data = var1.toByteArray();
+               packet.length = var1.size();
+               packet.isChunkDataPacket = true;
+               return packet;
+       }
+
+}
diff --git a/common/chemicraft/tileentity/TileEntityChemicalCombinationTable.java b/common/chemicraft/tileentity/TileEntityChemicalCombinationTable.java
new file mode 100644 (file)
index 0000000..dc90bb7
--- /dev/null
@@ -0,0 +1,371 @@
+package chemicraft.tileentity;
+
+import java.io.DataOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.packet.Packet;
+import net.minecraft.tileentity.TileEntity;
+import chemicraft.ChemiCraft;
+import chemicraft.ChemiCraftData;
+import chemicraft.inventory.InventoryChemicalCombinationTableMaterial;
+import chemicraft.inventory.InventoryChemicalCombinationTableResult;
+import chemicraft.system.PacketHandler;
+import chemicraft.util.ComparatorItemStack;
+
+import com.google.common.io.ByteArrayDataInput;
+
+import cpw.mods.fml.common.network.PacketDispatcher;
+
+public class TileEntityChemicalCombinationTable extends TileEntity {
+
+       private InventoryChemicalCombinationTableMaterial invm = new InventoryChemicalCombinationTableMaterial();
+       private InventoryChemicalCombinationTableResult invr = new InventoryChemicalCombinationTableResult();
+
+       private ArrayList<String> atomsList = new ArrayList<String>();
+       private ArrayList<Integer> atomsAmountList = new ArrayList<Integer>();
+       private int atomsListSize = 0;
+
+       private ItemStack dropItems;
+
+       private boolean isProvidePower;
+
+       @Override
+       public void updateEntity(){
+               super.updateEntity();
+               if (this.isProvidePower && !this.worldObj.isRemote) {
+                       this.field_00001();
+                       this.isProvidePower = false;
+                       PacketDispatcher.sendPacketToAllPlayers(this.getDescriptionPacket());
+               }
+       }
+
+       @Override
+       public void readFromNBT(NBTTagCompound par1){
+               super.readFromNBT(par1);
+               NBTTagList var2 = par1.getTagList("Items");
+               for (int var3 = 0; var3 < var2.tagCount(); ++var3)
+               {
+                       NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
+                       int var5 = var4.getByte("Slot") & 255;
+
+                       if  (var5 >= 0 && var5 < this.invm.getSizeInventory())
+                       {
+                               this.invm.setInventorySlotContents(var5, ItemStack.loadItemStackFromNBT(var4));
+                       }
+               }
+
+               NBTTagList var6 = par1.getTagList("Items2");
+               for (int var3 = 0; var3 < var6.tagCount(); ++var3)
+               {
+                       NBTTagCompound var7 = (NBTTagCompound)var6.tagAt(var3);
+                       int var8 = var7.getByte("Slot2") & 255;
+
+                       if  (var8 >= 0 && var8 < this.invr.getSizeInventory())
+                       {
+                               this.invr.setInventorySlotContents(var8, ItemStack.loadItemStackFromNBT(var7));
+                       }
+               }
+
+               this.atomsListSize = par1.getInteger("atomsListSize");
+               for(int i = 0;i < this.atomsListSize;i++){
+                       this.atomsList.add(par1.getString("atomsList" + i));
+               }
+               for(int i = 0;i < this.atomsListSize;i++){
+                       this.atomsAmountList.add(par1.getInteger("atomsAmountList" + i));
+               }
+
+               this.isProvidePower = par1.getBoolean("isProvidePower");
+       }
+
+       @Override
+       public void writeToNBT(NBTTagCompound par1){
+               super.writeToNBT(par1);
+               NBTTagList var2 = new NBTTagList();
+               for (int var3 = 0; var3 < this.invm.getSizeInventory(); ++var3)
+               {
+                       if  (this.invm.getStackInSlot(var3) != null)
+                       {
+                               NBTTagCompound var4 = new NBTTagCompound();
+                               var4.setByte("Slot", (byte)var3);
+                               this.invm.getStackInSlot(var3).writeToNBT(var4);
+                               var2.appendTag(var4);
+                       }
+               }
+               par1.setTag("Items", var2);
+
+               NBTTagList var5 = new NBTTagList();
+               for (int var6 = 0; var6 < this.invr.getSizeInventory(); ++var6)
+               {
+                       if  (this.invr.getStackInSlot(var6) != null)
+                       {
+                               NBTTagCompound var7 = new NBTTagCompound();
+                               var7.setByte("Slot2", (byte)var6);
+                               this.invr.getStackInSlot(var6).writeToNBT(var7);
+                               var5.appendTag(var7);
+                       }
+               }
+               par1.setTag("Items2", var5);
+
+               this.atomsList.trimToSize();
+               this.atomsAmountList.trimToSize();
+               for(int i = 0;i < this.atomsList.size();i++){
+                       par1.setString("atomsList" + i, this.atomsList.get(i));
+               }
+               for(int i = 0;i < this.atomsAmountList.size();i++){
+                       par1.setInteger("atomsAmountList" + i, this.atomsAmountList.get(i));
+               }
+
+               this.atomsListSize = this.atomsList.size();
+               par1.setInteger("atomsListSize", this.atomsListSize);
+
+               par1.setBoolean("isProvidePower", this.isProvidePower);
+       }
+
+       @Override
+       public Packet getDescriptionPacket() {
+               return PacketHandler.getPacket(this);
+       }
+
+       public void readPacket(ByteArrayDataInput data) {
+               try {
+                       for(int i = 0;i < this.invm.getSizeInventory();i++){
+                               int id = data.readInt();
+                               int size = data.readByte();
+                               int damage = data.readInt();
+                               if (id != 0 && size != 0){
+                                       this.invm.setInventorySlotContents(i, new ItemStack(id, size, damage));
+                               }else{
+                                       this.invm.setInventorySlotContents(i, null);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invr.getSizeInventory();i++){
+                               int id = data.readInt();
+                               int size = data.readByte();
+                               int damage = data.readInt();
+                               if (id != 0 && size != 0){
+                                       this.invr.setInventorySlotContents(i, new ItemStack(id, size, damage));
+                               }else{
+                                       this.invr.setInventorySlotContents(i, null);
+                               }
+                       }
+
+                       this.atomsListSize = data.readInt();
+                       this.atomsList.clear();
+                       this.atomsAmountList.clear();
+                       for(int i = 0;i < this.atomsListSize;i++){
+                               this.atomsList.add(data.readUTF());
+                       }
+                       for(int i = 0;i < this.atomsListSize;i++){
+                               this.atomsAmountList.add(data.readInt());
+                       }
+
+                       ItemStack itemstack = new ItemStack(data.readInt(), data.readByte(), data.readInt());
+                       if(itemstack.itemID != 0 && !this.worldObj.isRemote){
+                               this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, itemstack));
+                       }
+                       this.dropItems = null;
+
+                       this.isProvidePower = data.readBoolean();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public void writePacket(DataOutputStream dos){
+               try {
+                       for(int i = 0;i < this.invm.getSizeInventory();i++){
+                               int id = 0;
+                               int size = 0;
+                               int damage  = 0;
+                               ItemStack itemstack = this.invm.getStackInSlot(i);
+                               if (itemstack != null){
+                                       id = itemstack.itemID;
+                                       size = itemstack.stackSize;
+                                       damage = itemstack.getItemDamage();
+                                       dos.writeInt(id);
+                                       dos.writeByte(size);
+                                       dos.writeInt(damage);
+                               }else{
+                                       dos.writeInt(0);
+                                       dos.writeByte(0);
+                                       dos.writeInt(0);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invr.getSizeInventory();i++){
+                               int id = 0;
+                               int size = 0;
+                               int damage  = 0;
+                               ItemStack itemstack = this.invr.getStackInSlot(i);
+                               if (itemstack != null){
+                                       id = itemstack.itemID;
+                                       size = itemstack.stackSize;
+                                       damage = itemstack.getItemDamage();
+                                       dos.writeInt(id);
+                                       dos.writeByte(size);
+                                       dos.writeInt(damage);
+                               }else{
+                                       dos.writeInt(0);
+                                       dos.writeByte(0);
+                                       dos.writeInt(0);
+                               }
+                       }
+
+                       dos.writeInt(this.atomsList.size());
+                       for(int i = 0;i < this.atomsList.size();i++){
+                               dos.writeUTF(this.atomsList.get(i));
+                       }
+                       for(int i = 0;i < this.atomsAmountList.size();i++){
+                               dos.writeInt(this.atomsAmountList.get(i));
+                       }
+
+                       if (this.dropItems != null){
+                               int id = this.dropItems.itemID;
+                               int size = this.dropItems.stackSize;
+                               int damage = this.dropItems.getItemDamage();
+                               dos.writeInt(id);
+                               dos.writeByte(size);
+                               dos.writeInt(damage);
+                       }else{
+                               dos.writeInt(0);
+                               dos.writeByte(0);
+                               dos.writeInt(0);
+                       }
+                       this.dropItems = null;
+
+                       dos.writeBoolean(this.isProvidePower);
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public void setAtoms(String par1, int par2){
+               if (this.atomsList.indexOf(par1) != -1){
+                       int var1 = this.atomsList.indexOf(par1);
+                       this.atomsAmountList.set(var1, this.atomsAmountList.get(var1) + par2);
+               }else{
+                       this.atomsList.add(par1);
+                       this.atomsAmountList.add(par2);
+               }
+               PacketDispatcher.sendPacketToAllPlayers(this.getDescriptionPacket());
+       }
+
+       public void setDropItems(ItemStack par1ItemStack){
+               this.dropItems = par1ItemStack;
+       }
+
+       public String getAtoms(){
+               StringBuffer var1 = new StringBuffer();
+               for(int i = 0;i < this.atomsList.size();i++){
+                       if (this.atomsAmountList.get(i) != 1){
+                               var1.append(this.atomsList.get(i) + this.atomsAmountList.get(i));
+                       }else{
+                               var1.append(this.atomsList.get(i));
+                       }
+               }
+               return var1.toString();
+       }
+
+       public ArrayList<String> getAtomsList(){
+               return this.atomsList;
+       }
+
+       public ArrayList<Integer> getAtomsAmountList(){
+               return this.atomsAmountList;
+       }
+
+       public void emptytoAtomsList(){
+               this.atomsList.clear();
+               this.atomsAmountList.clear();
+       }
+
+       public void setProvidePower(boolean par1) {
+               this.isProvidePower = par1;
+       }
+
+       public boolean getProvidePower() {
+               return this.isProvidePower;
+       }
+
+       public void field_00001() {
+               IInventory inv = this.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){
+                               this.setAtoms(ChemiCraftData.ATOMSLIST[stacks[i].getItemDamage()], stacks[i].stackSize);
+                       }else{
+                               this.setAtoms(ChemiCraftData.ATOMSLIST[stacks[i].getItemDamage()], 1);
+                       }
+               }
+
+               for(int i = 0;i < inv.getSizeInventory();i++){
+                       inv.setInventorySlotContents(i, null);
+               }
+       }
+
+       public void field_00002() {
+               ArrayList<String> var1 = this.getAtomsList();
+               ArrayList<Integer> var2 = this.getAtomsAmountList();
+
+               for (int i = 0;i < var1.size();i++) {
+                       for (int j = 0;j < ChemiCraftData.ATOMSLIST.length;j++) {
+                               if (var1.get(i).equals(ChemiCraftData.ATOMSLIST[j])) {
+                                       int var3 = var2.get(i);
+                                       while(var3 > 0){
+                                               if(var3 > 64){
+                                                       ItemStack itemstack = new ItemStack(ChemiCraft.instance.itemAtoms, 64, j);
+                                                       this.setDropItems(itemstack);
+                                                       PacketDispatcher.sendPacketToServer(this.getDescriptionPacket());
+                                                       var3 -= 64;
+                                               }else{
+                                                       ItemStack itemstack = new ItemStack(ChemiCraft.instance.itemAtoms, var3, j);
+                                                       this.setDropItems(itemstack);
+                                                       PacketDispatcher.sendPacketToServer(this.getDescriptionPacket());
+                                                       var3 = 0;
+                                               }
+                                       }
+                                       break;
+                               }
+                       }
+               }
+               IInventory invr = this.getInvResult();
+               if (invr.getStackInSlot(0) != null) {
+                       invr.setInventorySlotContents(0, null);
+               }
+               this.emptytoAtomsList();
+       }
+
+       protected boolean isNumber(String par1){
+               try {
+                       int var1 = Integer.valueOf(new String(par1));
+               } catch (Exception e) {
+                       return false;
+               }
+               return true;
+       }
+
+       public InventoryChemicalCombinationTableMaterial getInvMaterial(){
+               return this.invm;
+       }
+
+       public InventoryChemicalCombinationTableResult getInvResult(){
+               return this.invr;
+       }
+
+}
+
diff --git a/common/chemicraft/tileentity/TileEntityChemicalCraftingTable.java b/common/chemicraft/tileentity/TileEntityChemicalCraftingTable.java
new file mode 100644 (file)
index 0000000..dfd5a19
--- /dev/null
@@ -0,0 +1,143 @@
+package chemicraft.tileentity;
+
+import java.io.DataOutputStream;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.packet.Packet;
+import net.minecraft.tileentity.TileEntity;
+import chemicraft.inventory.InventoryChemicalCraftingMaterial;
+import chemicraft.inventory.InventoryChemicalCraftingNBT;
+import chemicraft.inventory.InventoryChemicalCraftingResult;
+import chemicraft.system.PacketHandler;
+
+import com.google.common.io.ByteArrayDataInput;
+
+public class TileEntityChemicalCraftingTable extends TileEntity {
+
+       public IInventory chemicalCraftingInvMaterial = new InventoryChemicalCraftingMaterial();
+       public IInventory chemicalCraftingInvResult = new InventoryChemicalCraftingResult();
+       public IInventory chemicalCraftingInvNBT = new InventoryChemicalCraftingNBT();
+
+
+       public TileEntityChemicalCraftingTable() {
+               super();
+       }
+
+       @Override
+       public void updateEntity() {
+               super.updateEntity();
+       }
+
+
+       @Override
+       public void readFromNBT(NBTTagCompound par1) {
+               super.readFromNBT(par1);
+
+               NBTTagList var2 = par1.getTagList("Items");
+               for (int var3 = 0; var3 < var2.tagCount(); ++var3)
+               {
+                       NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
+                       int var5 = var4.getByte("Slot") & 255;
+
+                       if (var5 >= 0 && var5 < this.chemicalCraftingInvMaterial.getSizeInventory())
+                       {
+                               this.chemicalCraftingInvMaterial.setInventorySlotContents(var5, ItemStack.loadItemStackFromNBT(var4));
+                       }
+               }
+
+               NBTTagList var6 = par1.getTagList("Items2");
+               for (int var7 = 0; var7 < var6.tagCount(); ++var7)
+               {
+                       NBTTagCompound var4 = (NBTTagCompound)var6.tagAt(var7);
+                       int var5 = var4.getByte("Slot2") & 255;
+
+                       if (var5 >= 0 && var5 < this.chemicalCraftingInvResult.getSizeInventory())
+                       {
+                               this.chemicalCraftingInvResult.setInventorySlotContents(var5, ItemStack.loadItemStackFromNBT(var4));
+                       }
+               }
+
+               NBTTagList var8 = par1.getTagList("Items3");
+               for (int var9 = 0; var9 < var8.tagCount(); ++var9)
+               {
+                       NBTTagCompound var11 = (NBTTagCompound)var8.tagAt(var9);
+                       int var10 = var11.getByte("Slot3") & 255;
+
+                       if (var10 >= 0 && var10 < this.chemicalCraftingInvNBT.getSizeInventory())
+                       {
+                               this.chemicalCraftingInvNBT.setInventorySlotContents(var10, ItemStack.loadItemStackFromNBT(var11));
+                       }
+               }
+       }
+
+
+       @Override
+       public void writeToNBT(NBTTagCompound par1) {
+               super.writeToNBT(par1);
+
+               NBTTagList var2 = new NBTTagList();
+               for (int var3 = 0; var3 < this.chemicalCraftingInvMaterial.getSizeInventory(); ++var3)
+               {
+                       if (this.chemicalCraftingInvMaterial.getStackInSlot(var3) != null)
+                       {
+                               NBTTagCompound var4 = new NBTTagCompound();
+                               var4.setByte("Slot", (byte)var3);
+                               this.chemicalCraftingInvMaterial.getStackInSlot(var3).writeToNBT(var4);
+                               var2.appendTag(var4);
+                       }
+               }
+               par1.setTag("Items", var2);
+
+               NBTTagList var5 = new NBTTagList();
+               for (int var6 = 0; var6 < this.chemicalCraftingInvResult.getSizeInventory(); ++var6)
+               {
+                       if (this.chemicalCraftingInvResult.getStackInSlot(var6) != null)
+                       {
+                               NBTTagCompound var7 = new NBTTagCompound();
+                               var7.setByte("Slot2", (byte)var6);
+                               this.chemicalCraftingInvResult.getStackInSlot(var6).writeToNBT(var7);
+                               var5.appendTag(var7);
+                       }
+               }
+               par1.setTag("Items2", var5);
+
+               NBTTagList var8 = new NBTTagList();
+               for (int var9 = 0; var9 < this.chemicalCraftingInvNBT.getSizeInventory(); ++var9)
+               {
+                       if (this.chemicalCraftingInvNBT.getStackInSlot(var9) != null)
+                       {
+                               NBTTagCompound var10 = new NBTTagCompound();
+                               var10.setByte("Slot3", (byte)var9);
+                               this.chemicalCraftingInvNBT.getStackInSlot(var9).writeToNBT(var10);
+                               var8.appendTag(var10);
+                       }
+               }
+               par1.setTag("Items3", var8);
+       }
+
+
+       @Override
+       public Packet getDescriptionPacket() {
+               return PacketHandler.getPacket(this);
+       }
+
+
+       public void readPacket(ByteArrayDataInput data) {
+               try {
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+
+       public void writePacket(DataOutputStream dos){
+               try {
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+}
diff --git a/common/chemicraft/tileentity/TileEntityPyrolysisTable.java b/common/chemicraft/tileentity/TileEntityPyrolysisTable.java
new file mode 100644 (file)
index 0000000..40fd89e
--- /dev/null
@@ -0,0 +1,509 @@
+package chemicraft.tileentity;
+
+import java.io.DataOutputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.packet.Packet;
+import net.minecraft.tileentity.TileEntity;
+import chemicraft.debug.DebugData;
+import chemicraft.debug.DebugTick;
+import chemicraft.inventory.InventoryPyrolysisTableFuel;
+import chemicraft.inventory.InventoryPyrolysisTableMaterial;
+import chemicraft.inventory.InventoryPyrolysisTableResult;
+import chemicraft.system.PacketHandler;
+
+import com.google.common.io.ByteArrayDataInput;
+
+import cpw.mods.fml.common.network.PacketDispatcher;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class TileEntityPyrolysisTable extends TileEntity {
+
+       private InventoryPyrolysisTableMaterial invm = new InventoryPyrolysisTableMaterial();
+       private InventoryPyrolysisTableResult invr = new InventoryPyrolysisTableResult();
+       private InventoryPyrolysisTableFuel invf = new InventoryPyrolysisTableFuel();
+
+       /**
+        * 熱量
+        */
+       private float heat = 0;
+
+       /**
+        * 素材の加熱時間
+        */
+       private float burnTime = 0;
+
+       /**
+        * 燃料の残り燃焼時間
+        */
+       private float fuelRestTime = 0;
+
+       /**
+        * 最大熱量
+        */
+       private static final int MAX_HEAT = 1700;
+
+       /**
+        * 燃料が燃え始める最低熱量
+        */
+       private static final int MIN_HEAT = 400;
+
+       /**
+        * 燃料の燃焼速度比率・素材の燃焼速度比率の中心となる熱量
+        */
+       private static final int CENTER_HEAT = 1050;
+
+       /**
+        * 分解までの時間
+        */
+       private static final int MAX_BURN_TIME = 2000;
+
+       /**
+        * Random of instance.
+        */
+       public static final Random rand = new Random();
+
+       /**
+        * 燃料のリスト。
+        */
+       private static HashMap<ItemStack, Integer> fuelList = new HashMap<ItemStack, Integer>();
+
+       /**
+        * レシピのリスト
+        */
+       private static HashMap<ItemStack, ItemStack[]> recipeList = new HashMap<ItemStack, ItemStack[]>();
+
+       @Override
+       public void updateEntity() {
+
+               //boolean var2 = false;
+
+               boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
+               if (this.worldObj.getBlockId(xCoord, yCoord-1, zCoord) == Block.fire.blockID) {
+                       if (this.heat < 1700) {
+                               if (this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
+                                       this.heat += 0.1F;
+                               } else if (this.worldObj.isThundering() && var1) {
+                                       this.heat += 0.25F;
+                               } else {
+                                       this.heat += 3F;
+                               }
+                       } else {
+                               this.heat = 1700;
+                       }
+               } else {
+                       if (this.heat > 0) {
+                               if(this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
+                                       this.heat -= 0.25F;
+                               } else if(this.worldObj.isThundering() && var1) {
+                                       this.heat -= 0.5F;
+                               } else {
+                                       this.heat -= 0.05F;
+                               }
+                       } else {
+                               this.heat = 0;
+                       }
+               }
+
+               if (this.fuelRestTime >= 0) {
+                       this.burnTime += 10 * CENTER_HEAT / this.heat;
+                       this.fuelRestTime -= 10 * CENTER_HEAT / this.heat;
+               }
+
+               if (this.burnTime >= MAX_BURN_TIME) {
+                       Iterator<ItemStack> itMaterial = recipeList.keySet().iterator();
+                       while (itMaterial.hasNext()) {
+                               ItemStack itemstackMaterial = itMaterial.next();
+                               ItemStack materialItem = this.invm.getStackInSlot(0);
+                               if (materialItem != null) {
+                                       if (this.isInItemCheck(itemstackMaterial)) {
+                                               //var2 = true;
+                                               if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
+                                                       this.inItem(itemstackMaterial);
+                                                       if (materialItem.stackSize >= 1) {
+                                                               this.invm.setInventorySlotContents(0, new ItemStack(materialItem.itemID, --materialItem.stackSize, materialItem.getItemDamage()));
+                                                       } else {
+                                                               this.invm.setInventorySlotContents(0, null);
+                                                       }
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+                       this.burnTime = 0;
+               }
+
+               boolean var3 = false;
+               if (this.heat > MIN_HEAT) {
+                       Iterator<ItemStack> itMaterial = recipeList.keySet().iterator();
+                       while (itMaterial.hasNext()) {
+                               ItemStack itemstackMaterial = itMaterial.next();
+                               ItemStack materialItem = this.invm.getStackInSlot(0);
+                               if (materialItem != null) {
+                                       if (this.isInItemCheck(itemstackMaterial)) {
+                                               //var2 = true;
+                                               if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
+                                                       var3 = true;
+                                                       if (this.fuelRestTime <= 0) {
+                                                               Iterator<ItemStack> itFuel = fuelList.keySet().iterator();
+                                                               while (itFuel.hasNext()) {
+                                                                       ItemStack itemstackFuel = itFuel.next();
+                                                                       ItemStack fuelItem = this.invf.getStackInSlot(0);
+                                                                       if (fuelItem != null) {
+                                                                               if (itemstackFuel.itemID == fuelItem.itemID && itemstackFuel.getItemDamage() == fuelItem.getItemDamage()) {
+                                                                                       this.fuelRestTime = fuelList.get(itemstackFuel);
+                                                                                       if (fuelItem.stackSize >= 1) {
+                                                                                               this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
+                                                                                               break;
+                                                                                       } else {
+                                                                                               this.invf.setInventorySlotContents(0, null);
+                                                                                               break;
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               } else {
+                                       this.burnTime = 0;
+                                       //var2 = false;
+                               }
+                       }
+                       if (!var3) {
+                               this.burnTime = 0;
+                       }
+               }
+
+               /*
+               DebugTick.setDebugData("PyrolysisTable" +
+                               "(x:" + this.xCoord +
+                               " y:" + this.yCoord +
+                               " z:" + this.zCoord + ")",
+                               new DebugData("Heat", this.heat),
+                               new DebugData("FuelRestTime", this.fuelRestTime),
+                               new DebugData("BurnTime", this.burnTime),
+                               new DebugData("アイテムが入るか", var2)
+                               );
+                */
+       }
+
+       @Override
+       public void readFromNBT(NBTTagCompound par1) {
+               super.readFromNBT(par1);
+               this.heat = par1.getFloat("Heat");
+               this.burnTime = par1.getFloat("BurnTime");
+               this.fuelRestTime = par1.getFloat("FuelRestTime");
+
+               NBTTagList var2 = par1.getTagList("Items");
+               for (int var3 = 0; var3 < var2.tagCount(); ++var3)
+               {
+                       NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
+                       int var5 = var4.getByte("Slot") & 255;
+
+                       if  (var5 >= 0 && var5 < this.invm.getSizeInventory())
+                       {
+                               this.invm.setInventorySlotContents(var5, ItemStack.loadItemStackFromNBT(var4));
+                       }
+               }
+
+               NBTTagList var6 = par1.getTagList("Items2");
+               for (int var3 = 0; var3 < var6.tagCount(); ++var3)
+               {
+                       NBTTagCompound var7 = (NBTTagCompound)var6.tagAt(var3);
+                       int var8 = var7.getByte("Slot2") & 255;
+
+                       if  (var8 >= 0 && var8 < this.invr.getSizeInventory())
+                       {
+                               this.invr.setInventorySlotContents(var8, ItemStack.loadItemStackFromNBT(var7));
+                       }
+               }
+
+               NBTTagList var9 = par1.getTagList("Items3");
+               for (int var3 = 0; var3 < var9.tagCount(); ++var3)
+               {
+                       NBTTagCompound var10 = (NBTTagCompound)var9.tagAt(var3);
+                       int var11 = var10.getByte("Slot3") & 255;
+
+                       if  (var11 >= 0 && var11 < this.invf.getSizeInventory())
+                       {
+                               this.invf.setInventorySlotContents(var11, ItemStack.loadItemStackFromNBT(var10));
+                       }
+               }
+       }
+
+       @Override
+       public void writeToNBT(NBTTagCompound par1) {
+               super.writeToNBT(par1);
+               par1.setFloat("Heat", this.heat);
+               par1.setFloat("BurnTime", this.burnTime);
+               par1.setFloat("FuelRestTime", this.fuelRestTime);
+
+               NBTTagList var2 = new NBTTagList();
+               for (int var3 = 0; var3 < this.invm.getSizeInventory(); ++var3)
+               {
+                       if  (this.invm.getStackInSlot(var3) != null)
+                       {
+                               NBTTagCompound var4 = new NBTTagCompound();
+                               var4.setByte("Slot", (byte)var3);
+                               this.invm.getStackInSlot(var3).writeToNBT(var4);
+                               var2.appendTag(var4);
+                       }
+               }
+               par1.setTag("Items", var2);
+
+               NBTTagList var5 = new NBTTagList();
+               for (int var6 = 0; var6 < this.invr.getSizeInventory(); ++var6)
+               {
+                       if  (this.invr.getStackInSlot(var6) != null)
+                       {
+                               NBTTagCompound var7 = new NBTTagCompound();
+                               var7.setByte("Slot2", (byte)var6);
+                               this.invr.getStackInSlot(var6).writeToNBT(var7);
+                               var5.appendTag(var7);
+                       }
+               }
+               par1.setTag("Items2", var5);
+
+               NBTTagList var8 = new NBTTagList();
+               for (int var9 = 0; var9 < this.invf.getSizeInventory(); ++var9)
+               {
+                       if  (this.invf.getStackInSlot(var9) != null)
+                       {
+                               NBTTagCompound var10 = new NBTTagCompound();
+                               var10.setByte("Slot3", (byte)var9);
+                               this.invf.getStackInSlot(var9).writeToNBT(var10);
+                               var8.appendTag(var10);
+                       }
+               }
+               par1.setTag("Items3", var8);
+       }
+
+       @Override
+       public Packet getDescriptionPacket() {
+               return PacketHandler.getPacket(this);
+       }
+
+       public void readPacket(ByteArrayDataInput data) {
+               try {
+                       this.heat = data.readFloat();
+                       this.burnTime = data.readInt();
+                       this.fuelRestTime = data.readFloat();
+                       for(int i = 0;i < this.invm.getSizeInventory();i++){
+                               int id = data.readInt();
+                               int size = data.readByte();
+                               int damage = data.readInt();
+                               if (id != 0 && size != 0){
+                                       this.invm.setInventorySlotContents(i, new ItemStack(id, size, damage));
+                               }else{
+                                       this.invm.setInventorySlotContents(i, null);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invr.getSizeInventory();i++){
+                               int id = data.readInt();
+                               int size = data.readByte();
+                               int damage = data.readInt();
+                               if (id != 0 && size != 0){
+                                       this.invr.setInventorySlotContents(i, new ItemStack(id, size, damage));
+                               }else{
+                                       this.invr.setInventorySlotContents(i, null);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invf.getSizeInventory();i++){
+                               int id = data.readInt();
+                               int size = data.readByte();
+                               int damage = data.readInt();
+                               if (id != 0 && size != 0){
+                                       this.invf.setInventorySlotContents(i, new ItemStack(id, size, damage));
+                               }else{
+                                       this.invf.setInventorySlotContents(i, null);
+                               }
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+
+       public void writePacket(DataOutputStream dos){
+               try {
+                       dos.writeFloat(this.heat);
+                       dos.writeFloat(this.burnTime);
+                       dos.writeFloat(this.fuelRestTime);
+                       for(int i = 0;i < this.invm.getSizeInventory();i++){
+                               int id = 0;
+                               int size = 0;
+                               int damage  = 0;
+                               ItemStack itemstack = this.invm.getStackInSlot(i);
+                               if (itemstack != null){
+                                       id = itemstack.itemID;
+                                       size = itemstack.stackSize;
+                                       damage = itemstack.getItemDamage();
+                                       dos.writeInt(id);
+                                       dos.writeByte(size);
+                                       dos.writeInt(damage);
+                               }else{
+                                       dos.writeInt(0);
+                                       dos.writeByte(0);
+                                       dos.writeInt(0);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invr.getSizeInventory();i++){
+                               int id = 0;
+                               int size = 0;
+                               int damage  = 0;
+                               ItemStack itemstack = this.invr.getStackInSlot(i);
+                               if (itemstack != null){
+                                       id = itemstack.itemID;
+                                       size = itemstack.stackSize;
+                                       damage = itemstack.getItemDamage();
+                                       dos.writeInt(id);
+                                       dos.writeByte(size);
+                                       dos.writeInt(damage);
+                               }else{
+                                       dos.writeInt(0);
+                                       dos.writeByte(0);
+                                       dos.writeInt(0);
+                               }
+                       }
+
+                       for(int i = 0;i < this.invf.getSizeInventory();i++){
+                               int id = 0;
+                               int size = 0;
+                               int damage  = 0;
+                               ItemStack itemstack = this.invf.getStackInSlot(i);
+                               if (itemstack != null){
+                                       id = itemstack.itemID;
+                                       size = itemstack.stackSize;
+                                       damage = itemstack.getItemDamage();
+                                       dos.writeInt(id);
+                                       dos.writeByte(size);
+                                       dos.writeInt(damage);
+                               }else{
+                                       dos.writeInt(0);
+                                       dos.writeByte(0);
+                                       dos.writeInt(0);
+                               }
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public float getBurnTime() {
+               return this.burnTime;
+       }
+
+       public float getHeat() {
+               return this.heat;
+       }
+
+       public InventoryPyrolysisTableMaterial getInvMaterial() {
+               return this.invm;
+       }
+
+       public InventoryPyrolysisTableResult getInvResult() {
+               return this.invr;
+       }
+
+       public InventoryPyrolysisTableFuel getInvFuel() {
+               return this.invf;
+       }
+
+       public boolean isInItemCheck(ItemStack key) {
+               ItemStack[] results = recipeList.get(key).clone();
+               ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
+               for (int i = 0; i < this.invr.getSizeInventory(); i++) {
+                       containerResults[i] = this.invr.getStackInSlot(i);
+               }
+
+               for (int i = 0; i < results.length; i++) {
+                       int var1 = results[i].itemID;
+                       int var3 = results[i].getItemDamage();
+                       int var5 = results[i].stackSize;
+                       for (int j = 0; j < containerResults.length; j++) {
+                               if (containerResults[j] == null) {
+                                       results[i] = null;
+                                       break;
+                               } else {
+                                       int var2 = containerResults[j].itemID;
+                                       int var4 = containerResults[j].getItemDamage();
+                                       int var6 = containerResults[j].stackSize;
+                                       int var7 = containerResults[j].getMaxStackSize();
+                                       if (var1 == var2 && var3 == var4) {
+                                               if (var5 + var6 <= var7) {
+                                                       results[i] = null;
+                                                       break;
+                                               } else {
+                                                       var5 -= var7 - var6;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               for (int i = 0; i < results.length; i++) {
+                       if (results[i] != null) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
+       public void inItem(ItemStack key) {
+               ItemStack[] results = recipeList.get(key);
+               ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
+               for (int i = 0; i < this.invr.getSizeInventory(); i++) {
+                       containerResults[i] = this.invr.getStackInSlot(i);
+               }
+
+               for (int i = 0; i < results.length; i++) {
+                       int var1 = results[i].itemID;
+                       int var3 = results[i].getItemDamage();
+                       int var5 = results[i].stackSize;
+                       for (int j = 0; j < containerResults.length; j++) {
+                               if (containerResults[j] == null) {
+                                       this.invr.setInventorySlotContents(j, results[i]);
+                                       break;
+                               } else {
+                                       int var2 = containerResults[j].itemID;
+                                       int var4 = containerResults[j].getItemDamage();
+                                       int var6 = containerResults[j].stackSize;
+                                       int var7 = containerResults[j].getMaxStackSize();
+                                       if (var1 == var2 && var3 == var4) {
+                                               if (var5 + var6 <= var7) {
+                                                       System.out.println(var5);
+                                                       System.out.println(var6);
+                                                       System.out.println(var5 + var6);
+                                                       System.out.println(i);
+                                                       System.out.println(j);
+                                                       this.invr.setInventorySlotContents(j, new ItemStack(results[i].itemID, var5 + var6, results[i].getItemDamage()));
+                                                       break;
+                                               } else {
+                                                       this.invr.setInventorySlotContents(j, new ItemStack(results[i].itemID, var7, results[i].getItemDamage()));
+                                                       var5 -= var7 - var6;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       public static void addFuel(ItemStack itemstack, int burnTime) {
+               fuelList.put(itemstack, burnTime);
+       }
+
+       public static void addRecipe(ItemStack material, ItemStack[] result) {
+               recipeList.put(material, result);
+       }
+
+}
diff --git a/common/chemicraft/tileentity/TileEntityToolAndWeaponCraftingTable.java b/common/chemicraft/tileentity/TileEntityToolAndWeaponCraftingTable.java
new file mode 100644 (file)
index 0000000..44bc07e
--- /dev/null
@@ -0,0 +1,26 @@
+package chemicraft.tileentity;
+
+import java.io.DataOutputStream;
+
+import net.minecraft.tileentity.TileEntity;
+
+import com.google.common.io.ByteArrayDataInput;
+
+public class TileEntityToolAndWeaponCraftingTable extends TileEntity {
+
+       public void readPacket(ByteArrayDataInput data) {
+               try {
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+
+       public void writePacket(DataOutputStream dos){
+               try {
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+}
diff --git a/common/chemicraft/util/AtomInfo.java b/common/chemicraft/util/AtomInfo.java
new file mode 100644 (file)
index 0000000..ccc5f01
--- /dev/null
@@ -0,0 +1,162 @@
+package chemicraft.util;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * いろいろなデータを格納しメソッドによってチェックするクラス
+ * 使用する場合はItemAtomInfoContainerを継承することを推奨
+ * @author ponkotate
+ *
+ */
+public class AtomInfo {
+
+       /**
+        * X, Y, Z座標
+        */
+       private  int posX;
+       private  int posY;
+       private  int posZ;
+
+
+       /**
+        * biomeの名前
+        */
+       private  String biomeName;
+
+
+       /**
+        * 天候
+        */
+       private  String weather;
+
+
+       /**
+        * EntityPlayerのインスタンス
+        */
+       private EntityPlayer entityPlayer;
+
+
+       /**
+        * Worldのインスタンス
+        */
+       private World world;
+
+
+
+       /**
+        * AtomInfoのデータをupdateします
+        * @param par1World Worldのインスタンス
+        * @param par2EntityPlayer EntityPlayerのインスタンス
+        */
+       public void update(World par1World, EntityPlayer par2EntityPlayer){
+               //this.world = par1World;
+               //this.entityPlayer = par2EntityPlayer;
+
+               this.posX = (int) par2EntityPlayer.posX;
+               this.posY = (int) par2EntityPlayer.posY;
+               this.posZ = (int) par2EntityPlayer.posZ;
+
+               this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
+
+               if (par1World.isThundering()){
+                       this.weather = "Thunder";
+               }else if(par1World.isRaining()){
+                       this.weather = "Rain";
+               }else{
+                       this.weather = "Sun";
+               }
+       }
+
+
+
+       /**
+        * 引数に指定されたBiomeと同等か比較します
+        * @param biomeName 比較するBiomeの名前
+        * @return Biomeが一致しているか
+        */
+       public boolean isEquivalentBiome(String biomeName){
+               if(this.biomeName != null){
+                       if(this.biomeName.equals(biomeName)){
+                               return true;
+                       }else{
+                               return false;
+                       }
+               }else{
+                       System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
+                       return false;
+               }
+       }
+
+
+
+       /**
+        * 引数に指定された天候と同等か比較します
+        * 晴れ:Sun, 雨:Rain, 雷雨:Thunder
+        * @param weather 比較する天候
+        * @return 天候が一致しているか
+        */
+       public boolean isEquivalentWeather(String weather){
+               if(this.weather != null){
+                       if(this.weather.equals(weather)){
+                               return true;
+                       }else{
+                               return false;
+                       }
+               }else{
+                       System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");
+                       return false;
+               }
+       }
+
+
+
+       /**
+        * 引数に指定されたY軸より高いか判定します
+        * @param par1
+        * @return 指定されたY軸より高いか
+        */
+       @SideOnly(Side.CLIENT)
+       public boolean isOverY(int par1){
+               if(this.posY >= par1){
+                       return true;
+               }else{
+                       return false;
+               }
+       }
+
+
+
+       /**
+        * 引数に指定されたY軸と同等か判定します
+        * @param par1
+        * @return 指定されたY軸と同等かどうか
+        */
+       @SideOnly(Side.CLIENT)
+       public boolean isEquivalentY(int par1){
+               if(this.posY == par1){
+                       return true;
+               }else{
+                       return false;
+               }
+       }
+
+
+
+       /**
+        * 引数に指定されたY軸より低いか判定します
+        * @param par1
+        * @return 指定されたY軸より低いか
+        */
+       @SideOnly(Side.CLIENT)
+       public boolean isBelowY(int par1){
+               if(this.posY <= par1){
+                       return true;
+               }else{
+                       return false;
+               }
+       }
+
+}
diff --git a/common/chemicraft/util/Auxiliary.java b/common/chemicraft/util/Auxiliary.java
new file mode 100644 (file)
index 0000000..fbd32a4
--- /dev/null
@@ -0,0 +1,190 @@
+package chemicraft.util;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+
+public class Auxiliary {
+
+       /**
+        * 補助クラス
+        * @author mozipi
+        *
+        */
+       public static class NameAuxiliary {
+
+               /**
+                * 名前を設定します
+                * @param object
+                * @param Name
+                */
+               public void addName(Object object,Object name){
+                       LanguageRegistry.addName(object, (String) name);
+               }
+
+
+
+               /**
+                * 名前を設定します(ItemStack版)
+                * @param object
+                * @param name
+                * @param meta
+                */
+               public void addName(ItemStack itemstack,Object name){
+                       LanguageRegistry.addName(itemstack, (String) name);
+               }
+
+
+
+               /**
+                * 指定言語にそって名前を追加します
+                * @param object
+                * @param lang
+                * @param name
+                */
+               public void addName(Object object,String lang,Object name){
+                       LanguageRegistry.instance().addNameForObject(object, lang, (String) name);
+               }
+
+
+
+               /**
+                * 指定言語にそって名前を追加します(ItemStack版)
+                * @param object
+                * @param lang
+                * @param name
+                */
+               public void addName(ItemStack object,String lang,Object name){
+                       LanguageRegistry.instance().addNameForObject(object, lang, (String) name);
+               }
+
+
+
+               /**
+                * メタデータごとに名前を追加します(Block版)
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);
+                       }
+               }
+
+
+
+               /**
+                * メタデータごとに名前を追加します(Item版)
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);
+                       }
+               }
+
+
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Block版)
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,String lang,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);
+                       }
+               }
+
+
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Item版)
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,String lang, Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);
+                       }
+               }
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Block版)
+                * また、配列の前に任意の文字列を追加できます。
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,String lang, String string, Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, string + (String) name[i]);
+                       }
+               }
+
+
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Item版)
+                * また、配列の前に任意の文字列を追加できます。
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,String lang, String string, Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, string + (String) name[i]);
+                       }
+               }
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Block版)
+                * また、配列の後ろに任意の文字列を追加できます。
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,String lang, Object[] name, String string){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i] + string);
+                       }
+               }
+
+
+
+               /**
+                * 指定された言語にそってメタデータごとに名前を設定します(Item版)
+                * また、配列の後ろに任意の文字列を追加できます。
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,String lang, Object[] name, String string){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i] + string);
+                       }
+               }
+
+       }
+
+       public static class ArrayAuxiliary{
+
+               public ItemStack[] deleteNull(ItemStack[] array){
+                       int count = 0;
+                       ItemStack[] arrayCopy;
+                       for(int i = 0;i < array.length;i++){
+                               if(array[array.length - 1 - i] == null){
+                                       count++;
+                               }else{
+                                       break;
+                               }
+                       }
+                       arrayCopy = new ItemStack[array.length - count];
+                       for(int i = 0;i < arrayCopy.length;i++){
+                               arrayCopy[i] = array[i];
+                       }
+                       array = arrayCopy.clone();
+                       return array;
+               }
+
+       }
+
+}
diff --git a/common/chemicraft/util/ChemicalNBTRecipe.java b/common/chemicraft/util/ChemicalNBTRecipe.java
new file mode 100644 (file)
index 0000000..7fcf71e
--- /dev/null
@@ -0,0 +1,11 @@
+package chemicraft.util;
+
+import net.minecraft.item.ItemStack;
+
+public abstract class ChemicalNBTRecipe {
+
+       public abstract void setNBT(ItemStack[] materials, ItemStack result);
+
+       public abstract ItemStack[] getMatchItems(ItemStack[] materials);
+
+}
diff --git a/common/chemicraft/util/ChunkProviderChemical.java b/common/chemicraft/util/ChunkProviderChemical.java
new file mode 100644 (file)
index 0000000..31cb6a9
--- /dev/null
@@ -0,0 +1,687 @@
+package chemicraft.util;
+
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE;
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT;
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE;
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE;
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD;
+import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA;
+
+import java.util.List;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockSand;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.util.IProgressUpdate;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.SpawnerAnimals;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraft.world.gen.MapGenBase;
+import net.minecraft.world.gen.MapGenCaves;
+import net.minecraft.world.gen.MapGenRavine;
+import net.minecraft.world.gen.NoiseGeneratorOctaves;
+import net.minecraft.world.gen.feature.MapGenScatteredFeature;
+import net.minecraft.world.gen.feature.WorldGenDungeons;
+import net.minecraft.world.gen.feature.WorldGenLakes;
+import net.minecraft.world.gen.structure.MapGenMineshaft;
+import net.minecraft.world.gen.structure.MapGenStronghold;
+import net.minecraft.world.gen.structure.MapGenVillage;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.Event.Result;
+import net.minecraftforge.event.terraingen.ChunkProviderEvent;
+import net.minecraftforge.event.terraingen.PopulateChunkEvent;
+import net.minecraftforge.event.terraingen.TerrainGen;
+
+public class ChunkProviderChemical implements IChunkProvider
+{
+       /** RNG. */
+       private Random rand;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       private NoiseGeneratorOctaves noiseGen1;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       private NoiseGeneratorOctaves noiseGen2;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       private NoiseGeneratorOctaves noiseGen3;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       private NoiseGeneratorOctaves noiseGen4;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       public NoiseGeneratorOctaves noiseGen5;
+
+       /** A NoiseGeneratorOctaves used in generating terrain */
+       public NoiseGeneratorOctaves noiseGen6;
+       public NoiseGeneratorOctaves mobSpawnerNoise;
+
+       /** Reference to the World object. */
+       private World worldObj;
+
+       /** are map structures going to be generated (e.g. strongholds) */
+       private final boolean mapFeaturesEnabled;
+
+       /** Holds the overall noise array used in chunk generation */
+       private double[] noiseArray;
+       private double[] stoneNoise = new double[256];
+       private MapGenBase caveGenerator = new MapGenCaves();
+
+       /** Holds Stronghold Generator */
+       private MapGenStronghold strongholdGenerator = new MapGenStronghold();
+
+       /** Holds Village Generator */
+       private MapGenVillage villageGenerator = new MapGenVillage();
+
+       /** Holds Mineshaft Generator */
+       private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
+       private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
+
+       /** Holds ravine generator */
+       private MapGenBase ravineGenerator = new MapGenRavine();
+
+       /** The biomes that are used to generate the chunk */
+       private BiomeGenBase[] biomesForGeneration;
+
+       /** A double array that hold terrain noise from noiseGen3 */
+       double[] noise3;
+
+       /** A double array that hold terrain noise */
+       double[] noise1;
+
+       /** A double array that hold terrain noise from noiseGen2 */
+       double[] noise2;
+
+       /** A double array that hold terrain noise from noiseGen5 */
+       double[] noise5;
+
+       /** A double array that holds terrain noise from noiseGen6 */
+       double[] noise6;
+
+       /**
+        * Used to store the 5x5 parabolic field that is used during terrain generation.
+        */
+       float[] parabolicField;
+       int[][] field_73219_j = new int[32][32];
+
+       {
+               caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
+               strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD);
+               villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE);
+               mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT);
+               scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE);
+               ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE);
+       }
+
+       public ChunkProviderChemical(World par1World, long par2, boolean par4)
+       {
+               this.worldObj = par1World;
+               this.mapFeaturesEnabled = par4;
+               this.rand = new Random(par2);
+               this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
+               this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
+               this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
+               this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
+               this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
+               this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
+               this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
+
+               NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
+               noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
+               this.noiseGen1 = noiseGens[0];
+               this.noiseGen2 = noiseGens[1];
+               this.noiseGen3 = noiseGens[2];
+               this.noiseGen4 = noiseGens[3];
+               this.noiseGen5 = noiseGens[4];
+               this.noiseGen6 = noiseGens[5];
+               this.mobSpawnerNoise = noiseGens[6];
+       }
+
+       /**
+        * Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the
+        * temperature is low enough
+        */
+       public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
+       {
+               byte var4 = 4;
+               byte var5 = 16;
+               byte var6 = 63;
+               int var7 = var4 + 1;
+               byte var8 = 17;
+               int var9 = var4 + 1;
+               this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
+               this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
+
+               for (int var10 = 0; var10 < var4; ++var10)
+               {
+                       for (int var11 = 0; var11 < var4; ++var11)
+                       {
+                               for (int var12 = 0; var12 < var5; ++var12)
+                               {
+                                       double var13 = 0.125D;
+                                       double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
+                                       double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
+                                       double var19 = this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 0];
+                                       double var21 = this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 0];
+                                       double var23 = (this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 1] - var15) * var13;
+                                       double var25 = (this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 1] - var17) * var13;
+                                       double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
+                                       double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
+
+                                       for (int var31 = 0; var31 < 8; ++var31)
+                                       {
+                                               double var32 = 0.25D;
+                                               double var34 = var15;
+                                               double var36 = var17;
+                                               double var38 = (var19 - var15) * var32;
+                                               double var40 = (var21 - var17) * var32;
+
+                                               for (int var42 = 0; var42 < 4; ++var42)
+                                               {
+                                                       int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
+                                                       short var44 = 128;
+                                                       var43 -= var44;
+                                                       double var45 = 0.25D;
+                                                       double var49 = (var36 - var34) * var45;
+                                                       double var47 = var34 - var49;
+
+                                                       for (int var51 = 0; var51 < 4; ++var51)
+                                                       {
+                                                               if ((var47 += var49) > 0.0D)
+                                                               {
+                                                                       par3ArrayOfByte[var43 += var44] = (byte)Block.stone.blockID;
+                                                               }
+                                                               else if (var12 * 8 + var31 < var6)
+                                                               {
+                                                                       //par3ArrayOfByte[var43 += var44] = (byte)Block.waterStill.blockID;
+                                                               }
+                                                               else
+                                                               {
+                                                                       par3ArrayOfByte[var43 += var44] = 0;
+                                                               }
+                                                       }
+
+                                                       var34 += var38;
+                                                       var36 += var40;
+                                               }
+
+                                               var15 += var23;
+                                               var17 += var25;
+                                               var19 += var27;
+                                               var21 += var29;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Replaces the stone that was placed in with blocks that match the biome
+        */
+       public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
+       {
+               ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, par1, par2, par3ArrayOfByte, par4ArrayOfBiomeGenBase);
+               MinecraftForge.EVENT_BUS.post(event);
+               if (event.getResult() == Result.DENY) return;
+
+               byte var5 = 63;
+               double var6 = 0.03125D;
+               this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);
+
+               for (int var8 = 0; var8 < 16; ++var8)
+               {
+                       for (int var9 = 0; var9 < 16; ++var9)
+                       {
+                               BiomeGenBase var10 = par4ArrayOfBiomeGenBase[var9 + var8 * 16];
+                               float var11 = var10.getFloatTemperature();
+                               int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
+                               int var13 = -1;
+                               byte var14 = var10.topBlock;
+                               byte var15 = var10.fillerBlock;
+
+                               for (int var16 = 127; var16 >= 0; --var16)
+                               {
+                                       int var17 = (var9 * 16 + var8) * 128 + var16;
+
+                                       if (var16 <= 0 + this.rand.nextInt(5))
+                                       {
+                                               par3ArrayOfByte[var17] = (byte)Block.bedrock.blockID;
+                                       }
+                                       else
+                                       {
+                                               byte var18 = par3ArrayOfByte[var17];
+
+                                               if (var18 == 0)
+                                               {
+                                                       var13 = -1;
+                                               }
+                                               else if (var18 == Block.stone.blockID)
+                                               {
+                                                       if (var13 == -1)
+                                                       {
+                                                               if (var12 <= 0)
+                                                               {
+                                                                       var14 = 0;
+                                                                       var15 = (byte)Block.stone.blockID;
+                                                               }
+                                                               else if (var16 >= var5 - 4 && var16 <= var5 + 1)
+                                                               {
+                                                                       var14 = var10.topBlock;
+                                                                       var15 = var10.fillerBlock;
+                                                               }
+
+                                                               if (var16 < var5 && var14 == 0)
+                                                               {
+                                                                       if (var11 < 0.15F)
+                                                                       {
+                                                                               //var14 = (byte)Block.ice.blockID;
+                                                                       }
+                                                                       else
+                                                                       {
+                                                                               //var14 = (byte)Block.waterStill.blockID;
+                                                                       }
+                                                               }
+
+                                                               var13 = var12;
+
+                                                               if (var16 >= var5 - 1)
+                                                               {
+                                                                       par3ArrayOfByte[var17] = var14;
+                                                               }
+                                                               else
+                                                               {
+                                                                       par3ArrayOfByte[var17] = var15;
+                                                               }
+                                                       }
+                                                       else if (var13 > 0)
+                                                       {
+                                                               --var13;
+                                                               par3ArrayOfByte[var17] = var15;
+
+                                                               if (var13 == 0 && var15 == Block.sand.blockID)
+                                                               {
+                                                                       var13 = this.rand.nextInt(4);
+                                                                       var15 = (byte)Block.sandStone.blockID;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * loads or generates the chunk at the chunk location specified
+        */
+       public Chunk loadChunk(int par1, int par2)
+       {
+               return this.provideChunk(par1, par2);
+       }
+
+       /**
+        * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
+        * specified chunk from the map seed and chunk seed
+        */
+       public Chunk provideChunk(int par1, int par2)
+       {
+               this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
+               byte[] var3 = new byte[32768];
+               this.generateTerrain(par1, par2, var3);
+               this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
+               this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration);
+               this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
+               this.ravineGenerator.generate(this, this.worldObj, par1, par2, var3);
+
+               if (this.mapFeaturesEnabled)
+               {
+                       this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, var3);
+                       this.villageGenerator.generate(this, this.worldObj, par1, par2, var3);
+                       this.strongholdGenerator.generate(this, this.worldObj, par1, par2, var3);
+                       this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, var3);
+               }
+
+               Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
+               byte[] var5 = var4.getBiomeArray();
+
+               for (int var6 = 0; var6 < var5.length; ++var6)
+               {
+                       var5[var6] = (byte)this.biomesForGeneration[var6].biomeID;
+               }
+
+               var4.generateSkylightMap();
+               return var4;
+       }
+
+       /**
+        * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the
+        * size.
+        */
+       private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
+       {
+               ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
+               MinecraftForge.EVENT_BUS.post(event);
+               if (event.getResult() == Result.DENY) return event.noisefield;
+
+               if (par1ArrayOfDouble == null)
+               {
+                       par1ArrayOfDouble = new double[par5 * par6 * par7];
+               }
+
+               if (this.parabolicField == null)
+               {
+                       this.parabolicField = new float[25];
+
+                       for (int var8 = -2; var8 <= 2; ++var8)
+                       {
+                               for (int var9 = -2; var9 <= 2; ++var9)
+                               {
+                                       float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
+                                       this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
+                               }
+                       }
+               }
+
+               double var44 = 684.412D;
+               double var45 = 684.412D;
+               this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
+               this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
+               this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
+               this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
+               this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
+               boolean var43 = false;
+               boolean var42 = false;
+               int var12 = 0;
+               int var13 = 0;
+
+               for (int var14 = 0; var14 < par5; ++var14)
+               {
+                       for (int var15 = 0; var15 < par7; ++var15)
+                       {
+                               float var16 = 0.0F;
+                               float var17 = 0.0F;
+                               float var18 = 0.0F;
+                               byte var19 = 2;
+                               BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
+
+                               for (int var21 = -var19; var21 <= var19; ++var21)
+                               {
+                                       for (int var22 = -var19; var22 <= var19; ++var22)
+                                       {
+                                               BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (par5 + 5)];
+                                               float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (var23.minHeight + 2.0F);
+
+                                               if (var23.minHeight > var20.minHeight)
+                                               {
+                                                       var24 /= 2.0F;
+                                               }
+
+                                               var16 += var23.maxHeight * var24;
+                                               var17 += var23.minHeight * var24;
+                                               var18 += var24;
+                                       }
+                               }
+
+                               var16 /= var18;
+                               var17 /= var18;
+        &nb