OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft
authormozipi <mozipi@users.sourceforge.jp>
Mon, 4 Feb 2013 09:29:19 +0000 (18:29 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Mon, 4 Feb 2013 09:29:19 +0000 (18:29 +0900)
Conflicts:
common/chemicraft/ChemiCraft.java

29 files changed:
common/chemicraft/ChemiCraft.java
common/chemicraft/ChemiCraftAPI.java
common/chemicraft/block/BlockChemicalCombinationTable.java
common/chemicraft/block/BlockChemicalCraftingTable.java
common/chemicraft/block/BlockPyrolysisTable.java
common/chemicraft/block/BlockToolAndWeaponCraftingTable.java
common/chemicraft/client/ClientProxy.java [moved from src/chemicraft/client/ClientProxy.java with 62% similarity]
common/chemicraft/compounds/CompoundDebug.java [new file with mode: 0644]
common/chemicraft/container/ContainerChemicalCombinationTable.java
common/chemicraft/container/ContainerElectrolysisTable.java [new file with mode: 0644]
common/chemicraft/container/ContainerToolAndWeaponCraftingTable.java
common/chemicraft/debug/DebugTick.java
common/chemicraft/gui/GuiChemicalCombinationTable.java
common/chemicraft/gui/GuiChemicalCraftingTable.java
common/chemicraft/gui/GuiElectrolysisTable.java
common/chemicraft/gui/GuiPyrolysisTable.java
common/chemicraft/gui/GuiToolAndWeaponCraftingTable.java
common/chemicraft/inventory/InventoryPyrolysisTableMaterial.java
common/chemicraft/inventory/InventoryPyrolysisTableResult.java
common/chemicraft/item/ItemAtoms.java
common/chemicraft/item/ItemCompounds.java
common/chemicraft/item/ItemGasCollectingBottle.java
common/chemicraft/render/RenderAtomsGrenade.java
common/chemicraft/slot/SlotPyrolysisTableMaterial.java
common/chemicraft/slot/SlotPyrolysisTableResult.java
common/chemicraft/system/CommonProxy.java
common/chemicraft/tileentity/TileEntityChemicalCombinationTable.java
common/chemicraft/tileentity/TileEntityPyrolysisTable.java
common/chemicraft/tileentity/TileEntityToolAndWeaponCraftingTable.java

index 8c8db7d..704344b 100644 (file)
-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.BlockElectrolysisTable;
-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.TileEntityElectrolysisTable;
-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 electrolysisTableID;
-       public int chemicalConbinationTableID;
-       public int toolAndWeaponCraftingTableID;
-       public int chemicalCraftingTableID;
-
-       /**
-        * GUIID.
-        */
-       public int guiPyrolysisTableID;
-       public int guiElectrolysisTableID;
-       public int guiChemicalCombinationTableID;
-       public int guiToolAndWeaponCraftingTableID;
-       public int guiChemicalCraftingTableID;
-
-       /**
-        * Block型変数.
-        */
-       public Block blockPyrolysisTable;
-       public Block blockElectrolysisTable;
-       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 final String ITEMATOMSTEXTURE = "/chemicraft/items/Atoms.png";
-       public final String ITEMCOMPOUNDSTEXTURE = "/chemicraft/items/Compounds.png";
-       public final String ITEMTEXTURE = "/chemicraft/items/items.png";
-       public final String BLOCKCHEMICALCRAFTINGTABLETEXTURE = "/chemicraft/blocks/cctable.png";
-       public final String GUIPYROLYSISTEXTURE = "/chemicraft/guis/Pyrolysis.png";
-       public final String GUIELECTROLYSISTEXTURE = "/chemicraft/guis/Electrolysis.png";
-       public final String GUICHEMICALCOMBINATIONTEXTURE = "/chemicraft/guis/ChemicalCombination.png";
-       public final String GUITOOLANDWEAPONCRAFTINGTEXTURE = "/chemicraft/guis/ToolAndWeaponCrafting.png";
-       public final 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 electrolysisTableIDProp = cfg.getBlock("ElectrolysisTable", 2401);
-               Property chemicalCombinationTableIDProp = cfg.getBlock("ChemicalCombinationID", 2402);
-               Property toolAndWeaponCraftingTableIDProp = cfg.getBlock("ToolAndWeaponCraftingTableID", 2403);
-               Property chemicalCraftingTableIDProp = cfg.getBlock("ChemicalCraftingTableID", 2404);
-
-               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.electrolysisTableID = electrolysisTableIDProp.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.blockElectrolysisTable = new BlockElectrolysisTable(this.electrolysisTableID, 0, Material.ground).
-                               setHardness(2.0F).
-                               setResistance(0.0F).
-                               setStepSound(Block.soundStoneFootstep).
-                               setBlockName("ElectrolysisTable");
-               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.blockElectrolysisTable, "ElectrolysisTable");
-               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.blockElectrolysisTable, "ElectrolysisTable");
-               this.nameAuxiliary.addName(this.blockElectrolysisTable, "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(TileEntityElectrolysisTable.class, "TileEntityElectrolysisTable");
-               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.blockElectrolysisTable),
-                               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.tnt),
-               });
-               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) {
-       }
-
-}
+package chemicraft;\r
+\r
+import net.minecraft.block.Block;\r
+import net.minecraft.block.material.Material;\r
+import net.minecraft.client.audio.SoundManager;\r
+import net.minecraft.creativetab.CreativeTabs;\r
+import net.minecraft.item.Item;\r
+import net.minecraft.item.ItemStack;\r
+import net.minecraftforge.common.Configuration;\r
+import net.minecraftforge.common.Property;\r
+import chemicraft.block.BlockChemicalCombinationTable;\r
+import chemicraft.block.BlockChemicalCraftingTable;\r
+import chemicraft.block.BlockPyrolysisTable;\r
+import chemicraft.block.BlockToolAndWeaponCraftingTable;\r
+import chemicraft.compounds.CompoundDebug;\r
+import chemicraft.compounds.CompoundWater;\r
+import chemicraft.debug.CommandDeleteItem;\r
+import chemicraft.debug.CommandGenDebugRoom;\r
+import chemicraft.debug.CommandSetTile;\r
+import chemicraft.item.ItemAtoms;\r
+import chemicraft.item.ItemAtomsGrenade;\r
+import chemicraft.item.ItemCompounds;\r
+import chemicraft.item.ItemGasCollectingBottle;\r
+import chemicraft.system.CommonProxy;\r
+import chemicraft.system.PacketHandler;\r
+import chemicraft.tileentity.TileEntityChemicalCombinationTable;\r
+import chemicraft.tileentity.TileEntityChemicalCraftingTable;\r
+import chemicraft.tileentity.TileEntityPyrolysisTable;\r
+import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;\r
+import chemicraft.util.Auxiliary;\r
+import chemicraft.util.Auxiliary.ArrayAuxiliary;\r
+import chemicraft.util.Auxiliary.NameAuxiliary;\r
+import chemicraft.util.CreativeTabAtoms;\r
+import chemicraft.util.NBTRecipeGrenade;\r
+import cpw.mods.fml.common.Mod;\r
+import cpw.mods.fml.common.SidedProxy;\r
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;\r
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;\r
+import cpw.mods.fml.common.event.FMLServerStartingEvent;\r
+import cpw.mods.fml.common.network.NetworkMod;\r
+import cpw.mods.fml.common.network.NetworkRegistry;\r
+import cpw.mods.fml.common.registry.GameRegistry;\r
+\r
+/**\r
+ * ChemiCraft本体\r
+ * @author P.C.C.\r
+ *\r
+ */\r
+@Mod(modid = "chemiCraft", name = "ChemiCraft", version = "beta")\r
+@NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraft", packetHandler = PacketHandler.class)\r
+public class ChemiCraft {\r
+\r
+       public static final String[] ATOMSNAME = {\r
+               "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon",\r
+               "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium",\r
+               "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttorium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium",\r
+               "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium",\r
+               "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum",\r
+               "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium",\r
+               "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium",\r
+               "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Ununtrium", "Ununquadium", "Ununpentium", "Ununhexium", "Ununseptium", "Ununoctium" };\r
+\r
+       public static final String[] ATOMSNAMEJP = {\r
+               "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン", "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム",\r
+               "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素", "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム",\r
+               "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル", "ヨウ素", "キセノン", "セシウム", "バリウム", "ランタン", "セリウム", "プラセオジム", "ネオジム", "プロメチウム", "サマリウム", "ユウロビウム", "ガドリニウム", "テルビウム", "ジスプロニウム",\r
+               "ホルミウム", "エルビウム", "ツリウム", "イッテルビウム", "ルテチウム", "ハフニウム", "タンタル", "タングステン", "レニウム", "オスミウム", "イリジウム", "白金", "金", "水銀", "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン", "フランシウム", "ラジウム",\r
+               "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム", "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム",\r
+               "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", "レントゲニウム", "コペルニシウム", "ウンウントリウム", "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "ウンウンセプチウム", "ウンウンオクチウム" };\r
+\r
+       /**\r
+        * このmodのインスタンス\r
+        */\r
+       @Mod.Instance("chemiCraft")\r
+       public static ChemiCraft instance;\r
+\r
+       /**\r
+        * ChemiCraftのProxy.\r
+        */\r
+       @SidedProxy(clientSide = "chemicraft.client.ClientProxy", serverSide = "chemicraft.system.CommonProxy")\r
+       public static CommonProxy proxy;\r
+\r
+       /**\r
+        * ChemiCraftのCreativeTab.\r
+        */\r
+       public static final CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");\r
+\r
+       /**\r
+        * ItemID.\r
+        */\r
+       public int atomsID;\r
+       public int compoundsID;\r
+       public int gasCollectingBottleID;\r
+       public int atomGrenadeID;\r
+\r
+       /**\r
+        * BlockID.\r
+        */\r
+       public int pyrolysisTableID;\r
+       public int chemicalConbinationTableID;\r
+       public int toolAndWeaponCraftingTableID;\r
+       public int chemicalCraftingTableID;\r
+\r
+       /**\r
+        * GUIID.\r
+        */\r
+       public int guiPyrolysisTableID;\r
+       public int guiChemicalCombinationTableID;\r
+       public int guiToolAndWeaponCraftingTableID;\r
+       public int guiChemicalCraftingTableID;\r
+\r
+       /**\r
+        * Block型変数.\r
+        */\r
+       public Block blockPyrolysisTable;\r
+       public Block blockChemicalCombinationTable;\r
+       public Block blockToolAndWeaponCraftingTable;\r
+       public Block blockChemicalCraftingTable;\r
+\r
+       /**\r
+        * Item型変数.\r
+        */\r
+       public Item itemAtoms;\r
+       public Item itemCompounds;\r
+       public Item itemGasCollectingBottle;\r
+       public Item itemAtomGrenade;\r
+\r
+       /**\r
+        * このmodで使用するTextureのパス.\r
+        */\r
+       public String itemAtomsTexture = "/chemicraft/items/Atoms.png";\r
+       public String itemCompoundsTexture = "/chemicraft/items/Compounds.png";\r
+       public String itemTexture = "/chemicraft/items/items.png";\r
+       public String blockChemicalCraftingTableTexture = "/chemicraft/blocks/cctable.png";\r
+       public String guiPyrolysisTexture = "/chemicraft/guis/Pyrolysis.png";\r
+       public String guiChemicalCombinationTexture = "/chemicraft/guis/ChemicalCombination.png";\r
+       public String guiToolAndWeaponCraftingTexture = "/chemicraft/guis/ToolAndWeaponCrafting.png";\r
+       public String guiChemicalCraftingTexture = "/chemicraft/guis/MaterialCrafting.png";\r
+\r
+       /**\r
+        * このmodに必要な補助クラスのインスタンス.\r
+        */\r
+       public Auxiliary auxiliary = new Auxiliary();\r
+       public NameAuxiliary nameAuxiliary = new NameAuxiliary();\r
+       public ArrayAuxiliary arrayAuxiliary = new ArrayAuxiliary();\r
+\r
+       private ChemiCraftAPI api = ChemiCraftAPI.getInstance();\r
+       private ChemiCraftData chemicalData = new ChemiCraftData();\r
+\r
+       @Mod.PreInit\r
+       public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {\r
+               Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
+               cfg.load();\r
+\r
+               Property pyrolysisTableIDProp = cfg.getBlock("PyrolysisTable", 2400);\r
+               Property chemicalCombinationTableIDProp = cfg.getBlock("ChemicalCombinationID", 2401);\r
+               Property toolAndWeaponCraftingTableIDProp = cfg.getBlock("ToolAndWeaponCraftingTableID", 2402);\r
+               Property chemicalCraftingTableIDProp = cfg.getBlock("ChemicalCraftingTableID", 2403);\r
+\r
+               Property atomsIDProp = cfg.getItem("AtomsID", 25000);\r
+               Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);\r
+               Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);\r
+               Property atomGrenadeIDProp = cfg.getItem("AtomGrenadeID", 25003);\r
+\r
+               Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);\r
+               Property guiChemicalCombinationTableIDProp = cfg.get("GUI", "GUIChemicalCombinationTableID", 1001);\r
+               Property guiToolAndWeaponCraftingTableIDProp = cfg.get("GUI", "GUIToolAndWeaponCraftingTableID", 1002);\r
+               Property guiChemicalCraftingTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1003);\r
+\r
+\r
+               this.pyrolysisTableID = pyrolysisTableIDProp.getInt();\r
+               this.chemicalConbinationTableID = chemicalCombinationTableIDProp.getInt();\r
+               this.toolAndWeaponCraftingTableID = toolAndWeaponCraftingTableIDProp.getInt();\r
+               this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();\r
+               this.atomsID = atomsIDProp.getInt();\r
+               this.compoundsID = compoundsIDProp.getInt();\r
+               this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
+               this.atomGrenadeID = atomGrenadeIDProp.getInt();\r
+               this.guiPyrolysisTableID = guiPyrolysisTableIDProp.getInt();\r
+               this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();\r
+               this.guiToolAndWeaponCraftingTableID = guiToolAndWeaponCraftingTableIDProp.getInt();\r
+               this.guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();\r
+\r
+               cfg.save();\r
+       }\r
+\r
+       @Mod.ServerStarting\r
+       public void serverStarting(final FMLServerStartingEvent event) {\r
+               event.registerServerCommand(new CommandSetTile());\r
+               event.registerServerCommand(new CommandDeleteItem());\r
+               event.registerServerCommand(new CommandGenDebugRoom());\r
+       }\r
+\r
+       @Mod.PostInit\r
+       public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {\r
+               this.settingProcessing(event);\r
+               this.apiProcessing(event);\r
+               this.debug(event);\r
+       }\r
+\r
+       private void settingProcessing(final FMLPostInitializationEvent event) {\r
+\r
+               // Blockを追加します\r
+               this.blockPyrolysisTable = new BlockPyrolysisTable(this.pyrolysisTableID, 0, Material.ground).\r
+                               setHardness(2.0F).\r
+                               setResistance(0.0F).\r
+                               setStepSound(Block.soundStoneFootstep).\r
+                               setBlockName("PyrolysisTable");\r
+               this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).\r
+                               setHardness(2.0F).\r
+                               setResistance(0.0F).\r
+                               setStepSound(Block.soundStoneFootstep).\r
+                               setBlockName("ChemicalCombinationTable");\r
+               this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 0, Material.ground).\r
+                               setHardness(2.0F).\r
+                               setResistance(0.0F).\r
+                               setStepSound(Block.soundStoneFootstep).\r
+                               setBlockName("ToolAndWeaponCraftingTable");\r
+               this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(chemicalCraftingTableID, 0, Material.ground).\r
+                               setHardness(2.0F).\r
+                               setResistance(0.0F).\r
+                               setStepSound(Block.soundStoneFootstep).\r
+                               setBlockName("ChemicalCraftingTable");\r
+\r
+               // Itemを追加します\r
+               this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");\r
+               this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");\r
+               this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);\r
+               this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);\r
+\r
+               // BlockをMinecraftに登録します\r
+               GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");\r
+               GameRegistry.registerBlock(this.blockChemicalCombinationTable, "BlockChemicalCombinationTable");\r
+               GameRegistry.registerBlock(this.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");\r
+               GameRegistry.registerBlock(this.blockChemicalCraftingTable, "BlockMaterialCraftingTable");\r
+\r
+               // Blockの名前を設定します\r
+               this.nameAuxiliary.addName(this.blockPyrolysisTable, "PyrolysisTable");\r
+               this.nameAuxiliary.addName(this.blockPyrolysisTable, "ja_JP", "熱分解台");\r
+               this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ChemicalCombinationTable");\r
+               this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ja_JP", "化合台");\r
+               this.nameAuxiliary.addName(blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");\r
+               this.nameAuxiliary.addName(blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");\r
+               this.nameAuxiliary.addName(blockChemicalCraftingTable, "ChemicalCraftingTable");\r
+               this.nameAuxiliary.addName(blockChemicalCraftingTable, "ja_JP", "素材製作台");\r
+\r
+               // Itemの名前を設定します\r
+               this.nameAuxiliary.addName(this.itemAtoms, ATOMSNAME);\r
+               this.nameAuxiliary.addName(this.itemAtoms, "ja_JP", ATOMSNAMEJP);\r
+               this.nameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");\r
+               this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");\r
+               this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");\r
+               this.nameAuxiliary.addName(this.itemAtomGrenade, "元素手榴弾");\r
+\r
+               // TileEntityを追加します\r
+               GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");\r
+               GameRegistry.registerTileEntity(TileEntityChemicalCombinationTable.class, "TileEntityChemicalCombinationTable");\r
+               GameRegistry.registerTileEntity(TileEntityToolAndWeaponCraftingTable.class, "TileEntityToolAndWeaponCraftingTable");\r
+               GameRegistry.registerTileEntity(TileEntityChemicalCraftingTable.class, "TileEntityChemicalCraftingTable");\r
+\r
+               // GUIを追加します\r
+               NetworkRegistry.instance().registerGuiHandler(instance, proxy);\r
+\r
+               // 描画関係の読み込み\r
+               proxy.registerRenderInformation();\r
+\r
+               //化学作業台類のレシピを追加します\r
+               GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),\r
+                               new Object[]{\r
+                       "XYX", "ZAZ", "ZZZ",\r
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),\r
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),\r
+                       Character.valueOf('Z'), new ItemStack(Block.stone),\r
+                       Character.valueOf('A'), new ItemStack(Item.bucketLava),\r
+               });\r
+               GameRegistry.addRecipe(new ItemStack(this.blockChemicalCombinationTable),\r
+                               new Object[]{\r
+                       "XYX", "ZAZ", "ZZZ",\r
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),\r
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),\r
+                       Character.valueOf('Z'), new ItemStack(Block.stone),\r
+                       Character.valueOf('A'), new ItemStack(Block.obsidian),\r
+               });\r
+               GameRegistry.addRecipe(new ItemStack(this.blockToolAndWeaponCraftingTable),\r
+                               new Object[]{\r
+                       "XYX", "ZAZ", "ZZZ",\r
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),\r
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),\r
+                       Character.valueOf('Z'), new ItemStack(Block.stone),\r
+                       Character.valueOf('A'), new ItemStack(Item.pickaxeSteel),\r
+               });\r
+               GameRegistry.addRecipe(new ItemStack(this.blockChemicalCraftingTable),\r
+                               new Object[]{\r
+                       "XYX", "ZAZ", "ZZZ",\r
+                       Character.valueOf('X'), new ItemStack(Item.ingotIron),\r
+                       Character.valueOf('Y'), new ItemStack(Block.workbench),\r
+                       Character.valueOf('Z'), new ItemStack(Block.stone),\r
+                       Character.valueOf('A'), new ItemStack(this.itemAtoms, 1, 0),\r
+               });\r
+\r
+               // 化合物を追加します\r
+               api.addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");\r
+               api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
+               api.addLangCompound("ja_JP", "Water", "水");\r
+
+\r
+               //化合物のHandlerを設定します\r
+               api.settingCompoundHandler("Water", new CompoundWater());\r
+\r
+               //化合物のレシピを追加します\r
+               api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("Water")));\r
+\r
+               //手榴弾の追加\r
+               api.addMaterialRecipe(new ItemStack[] {\r
+                               null,\r
+                               new ItemStack(Block.stone),\r
+                               null,\r
+                               new ItemStack(Block.stone),\r
+                               new ItemStack(Item.gunpowder),\r
+                               new ItemStack(Block.stone),\r
+                               null,\r
+                               new ItemStack(Block.stone),\r
+                               null\r
+               },\r
+               new ItemStack(this.itemAtomGrenade, 16, 0),\r
+               new NBTRecipeGrenade()\r
+                               );\r
+\r
+               api.addDecompositionRecipe(new ItemStack(Item.potion, 1, 0),\r
+                               new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},\r
+                               new int[] {2, 1});\r
+\r
+               api.addDecompositionRecipe(new ItemStack(this.itemCompounds, 1, api.getCompound("Water")),\r
+                               new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},\r
+                               new int[] {2, 1});\r
+\r
+               api.addDecompositionFuel(new ItemStack(Item.coal), 2000*8);\r
+       }\r
+\r
+       private void apiProcessing(final FMLPostInitializationEvent event) {\r
+               // API用の処理\r
+               this.nameAuxiliary.addName(itemCompounds, api.getInstance().getCompoundsName().toArray());\r
+               for (int i = 0; i < api.getCompoundsLang().size(); i++) {\r
+                       this.nameAuxiliary.addName(itemCompounds, api.getCompoundsLang().get(i), api.getInstance().getCompoundsLangName().toArray());\r
+               }\r
+       }\r
+\r
+       private void debug(final FMLPostInitializationEvent event) {\r
+               //DebugTickingの追加\r
+               this.proxy.registerTickHandler();\r
+               api.addCompound("Debug");\r
+               this.api.settingCompoundHandler("Debug", new CompoundDebug());\r
+       }\r
+\r
+}\r
index b7b64e6..a538fed 100644 (file)
@@ -61,18 +61,6 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 分解台の素材のリスト
-        */
-       private ArrayList<ItemStack> decompositionMaterial = new ArrayList<ItemStack>();
-
-
-       /**
-        * 分解台の結果のリスト
-        */
-       private ArrayList<ItemStack[]> decompositionResults = new ArrayList<ItemStack[]>();
-
-
-       /**
         * 化合台の原子の種類のリスト
         */
        private ArrayList<String[]> chemicalCombinationAtoms = new ArrayList<String[]>();
@@ -151,22 +139,6 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 分解レシピを追加します。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 結果
@@ -182,14 +154,14 @@ public class ChemiCraftAPI {
        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]);
+                       itemstacks[i] = new ItemStack(ChemiCraft.instance.itemAtoms,stacks[i], results[i]);
                }
                TileEntityPyrolysisTable.addRecipe(material, itemstacks);
        }
 
 
 
-       public void addDecompositionRecipe(ItemStack itemstack, int burnTime) {
+       public void addDecompositionFuel(ItemStack itemstack, int burnTime) {
                TileEntityPyrolysisTable.addFuel(itemstack, burnTime);
        }
 
@@ -242,18 +214,6 @@ public class ChemiCraftAPI {
 
 
 
-       public ArrayList<ItemStack> getDecompositionMaterial(){
-               return decompositionMaterial;
-       }
-
-
-
-       public ArrayList<ItemStack[]> getDecompositionResult(){
-               return decompositionResults;
-       }
-
-
-
        public ArrayList<String[]> getChemicalCombinationAtoms(){
                return chemicalCombinationAtoms;
        }
index bf9ba58..4562eda 100644 (file)
@@ -25,7 +25,7 @@ public class BlockChemicalCombinationTable extends BlockContainer {
 
        @Override
        public String getTextureFile() {
-               return ChemiCraft.instance.BLOCKCHEMICALCRAFTINGTABLETEXTURE;
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
index cc30be2..7bf1578 100644 (file)
@@ -26,7 +26,7 @@ public class BlockChemicalCraftingTable extends BlockContainer {
 
        @Override
        public String getTextureFile(){
-               return ChemiCraft.instance.BLOCKCHEMICALCRAFTINGTABLETEXTURE;
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
index 2030eea..728545f 100644 (file)
@@ -26,7 +26,7 @@ public class BlockPyrolysisTable extends BlockContainer {
 
        @Override
        public String getTextureFile(){
-               return ChemiCraft.instance.BLOCKCHEMICALCRAFTINGTABLETEXTURE;
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
index f375a01..463d2da 100644 (file)
@@ -25,7 +25,7 @@ public class BlockToolAndWeaponCraftingTable extends BlockContainer {
 
        @Override
        public String getTextureFile(){
-               return ChemiCraft.instance.BLOCKCHEMICALCRAFTINGTABLETEXTURE;
+               return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
similarity index 62%
rename from src/chemicraft/client/ClientProxy.java
rename to common/chemicraft/client/ClientProxy.java
index 5b856df..d001c82 100644 (file)
@@ -6,17 +6,8 @@ import net.minecraft.world.World;
 import net.minecraftforge.client.MinecraftForgeClient;
 import chemicraft.ChemiCraft;
 import chemicraft.debug.DebugTick;
-import chemicraft.entity.EntityAtomsGrenade;
-import chemicraft.gui.GuiChemicalCombinationTable;
-import chemicraft.gui.GuiChemicalCraftingTable;
 import chemicraft.gui.GuiPyrolysisTable;
-import chemicraft.gui.GuiToolAndWeaponCraftingTable;
-import chemicraft.render.RenderAtomsGrenade;
-import chemicraft.system.CommonProxy;
-import chemicraft.tileentity.TileEntityChemicalCombinationTable;
-import chemicraft.tileentity.TileEntityChemicalCraftingTable;
 import chemicraft.tileentity.TileEntityPyrolysisTable;
-import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 import cpw.mods.fml.client.FMLClientHandler;
 import cpw.mods.fml.client.registry.RenderingRegistry;
 import cpw.mods.fml.common.registry.TickRegistry;
@@ -26,14 +17,14 @@ public class ClientProxy extends CommonProxy {
 
        @Override
        public void registerRenderInformation() {
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.BLOCKCHEMICALCRAFTINGTABLETEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEMATOMSTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEMCOMPOUNDSTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEMTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUICHEMICALCOMBINATIONTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUIPYROLYSISTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUICHEMICALCRAFTINGTEXTURE);
-               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUITOOLANDWEAPONCRAFTINGTEXTURE);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.blockChemicalCraftingTableTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.itemAtomsTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.itemCompoundsTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.itemTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.guiChemicalCombinationTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.guiPyrolysisTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.guiChemicalCraftingTexture);
+               MinecraftForgeClient.preloadTexture(ChemiCraft.instance.guiToolAndWeaponCraftingTexture);
                RenderingRegistry.registerEntityRenderingHandler(EntityAtomsGrenade.class, new RenderAtomsGrenade(0.5F));
        }
 
diff --git a/common/chemicraft/compounds/CompoundDebug.java b/common/chemicraft/compounds/CompoundDebug.java
new file mode 100644 (file)
index 0000000..9e5bf24
--- /dev/null
@@ -0,0 +1,45 @@
+package chemicraft.compounds;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityLargeFireball;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import chemicraft.util.ICompoundHandler;
+
+public class CompoundDebug implements ICompoundHandler {
+
+       @Override
+       public ItemStack onItemRightClickHandler(ItemStack par1ItemStack,
+                       World par2World, EntityPlayer par3EntityPlayer) {
+               if (!par2World.isRemote) {
+                       double var1 = par3EntityPlayer.posX;
+                       double var2 = par3EntityPlayer.posY + 10;
+                       double var3 = par3EntityPlayer.posZ;
+                       double var4 = par3EntityPlayer.posX;
+                       double var5 = par3EntityPlayer.posY;
+                       double var6 = par3EntityPlayer.posZ;
+                       par2World.spawnEntityInWorld(new EntityLargeFireball(par2World, var1, var2, var3, var4, var5, var6));
+               }
+               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) {
+               return false;
+       }
+
+       @Override
+       public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
+                       Entity par3Entity, int par4, boolean par5) {
+
+       }
+
+       @Override
+       public int getIconIndexHandler() {
+               return 0;
+       }
+
+}
index 2244348..26ebd93 100644 (file)
@@ -1,6 +1,5 @@
 package chemicraft.container;
 
-import net.minecraft.block.Block;
 import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.inventory.Container;
 import net.minecraft.inventory.IInventory;
diff --git a/common/chemicraft/container/ContainerElectrolysisTable.java b/common/chemicraft/container/ContainerElectrolysisTable.java
new file mode 100644 (file)
index 0000000..c6e5d50
--- /dev/null
@@ -0,0 +1,69 @@
+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.inventory.InventoryElectrolysisFuel;
+import chemicraft.inventory.InventoryElectrolysisMaterial;
+import chemicraft.inventory.InventoryElectrolysisResult;
+import chemicraft.slot.SlotElectrolysisMaterial;
+import chemicraft.slot.SlotElectrolysisResult;
+import chemicraft.tileentity.TileEntityElectrolysisTable;
+
+public class ContainerElectrolysisTable extends Container
+{
+
+       private World worldObj;
+
+       private int posX;
+       private int posY;
+       private int posZ;
+
+       private TileEntityElectrolysisTable tileEntity;
+
+       private InventoryElectrolysisMaterial invm;
+       private InventoryElectrolysisResult invr;
+       private InventoryElectrolysisFuel invf;
+
+       public ContainerElectrolysisTable(EntityPlayer par1EntityPlayer, TileEntityElectrolysisTable par2) {
+               super();
+               this.worldObj = par2.worldObj;
+               this.posX = par2.xCoord;
+               this.posY = par2.yCoord;
+               this.posZ = par2.zCoord;
+               this.invm = (InventoryElectrolysisMaterial) this.tileEntity.getInvMaterial();
+               this.invr = (InventoryElectrolysisResult) this.tileEntity.getInvResult();
+               this.invf = (InventoryElectrolysisFuel) this.tileEntity.getInvFuel();
+
+               this.addSlotToContainer(new SlotElectrolysisMaterial(invm, 0, 123, 34));
+               for (int i = 0; i < 16; i++) {
+                       this.addSlotToContainer(new SlotElectrolysisResult(invr, i, 123, 34));
+               }
+               this.addSlotToContainer(new SlotElectrolysisResult(invf, 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, 85 + var3 * 18));
+                       }
+               }
+
+               for (var3 = 0; var3 < 9; ++var3)
+               {
+                       this.addSlotToContainer(new Slot(par1EntityPlayer.inventory, var3, 8 + var3 * 18, 143));
+               }
+
+       }
+
+       @Override
+       public boolean canInteractWith(EntityPlayer par1EntityPlayer)
+       {
+               return true;
+               //return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.electrolysisTableID ? false : par1EntityPlayer.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D;
+       }
+
+}
index acadb79..b6b7c2c 100644 (file)
@@ -2,17 +2,56 @@ 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.slot.SlotToolAndWeaponCraftingTableResult;
 import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 
 public class ContainerToolAndWeaponCraftingTable extends Container {
 
+       private World worldobj;
+
+       private int posX;
+       private int posY;
+       private int posZ;
+
+       private TileEntityToolAndWeaponCraftingTable tileentity;
+
        public ContainerToolAndWeaponCraftingTable(EntityPlayer par1EntityPlayer, TileEntityToolAndWeaponCraftingTable par2){
                super();
+               this.tileentity = par2;
+               this.worldobj = this.tileentity.worldObj;
+               this.posX = this.tileentity.xCoord;
+               this.posY = this.tileentity.yCoord;
+               this.posZ = this.tileentity.zCoord;
+
+               for (int i = 0; i < 3; i++) {
+                       for (int j = 0; j < 3; j++) {
+                               this.addSlotToContainer(new Slot(this.tileentity.invm, i * 3 + i, 30 + i * 18, 17 + j * 18));
+                       }
+               }
+
+               this.addSlotToContainer(new SlotToolAndWeaponCraftingTableResult(this.tileentity.invr, 0, 125, 36));
+
+               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));
+               }
+
        }
 
        @Override
        public boolean canInteractWith(EntityPlayer var1) {
-               return false;
+               return true;
        }
 
 }
index e168e75..1e1edde 100644 (file)
@@ -1,11 +1,9 @@
 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;
index 9fdab59..7daf181 100644 (file)
@@ -33,7 +33,7 @@ public class GuiChemicalCombinationTable extends GuiContainer {
 
        @Override
        protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
-               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.GUICHEMICALCOMBINATIONTEXTURE));
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCombinationTexture));
                this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
        }
 
index 9164481..a25ad96 100644 (file)
@@ -19,7 +19,7 @@ public class GuiChemicalCraftingTable extends GuiContainer {
 
        @Override
        protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3){
-               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.GUICHEMICALCRAFTINGTEXTURE));
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiChemicalCraftingTexture));
                this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
        }
 
index 0051383..5fe55f8 100644 (file)
@@ -3,21 +3,21 @@ package chemicraft.gui;
 import net.minecraft.client.gui.inventory.GuiContainer;
 import net.minecraft.entity.player.EntityPlayer;
 import chemicraft.ChemiCraft;
-import chemicraft.container.ContainerElectrolysis;
+import chemicraft.container.ContainerElectrolysisTable;
 import chemicraft.tileentity.TileEntityElectrolysisTable;
 
 public class GuiElectrolysisTable extends GuiContainer
 {
 
        public GuiElectrolysisTable(EntityPlayer par1EntityPlayer, TileEntityElectrolysisTable par2) {
-               super(new ContainerElectrolysis(par1EntityPlayer, par2));
+               super(new ContainerElectrolysisTable(par1EntityPlayer, par2));
                this.ySize = 204;
        }
 
        @Override
        protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)
        {
-               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.GUIELECTROLYSISTEXTURE));
+               //this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiElectrolysisTableTexture));
                this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
        }
 
index 0c7686d..903740c 100644 (file)
@@ -18,7 +18,7 @@ public class GuiPyrolysisTable extends GuiContainer{
 
        @Override
        protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
-               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.GUIPYROLYSISTEXTURE));
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiPyrolysisTexture));
                this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
        }
 
index 7440007..d3e9288 100644 (file)
@@ -14,7 +14,7 @@ public class GuiToolAndWeaponCraftingTable extends GuiContainer {
 
        @Override
        protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
-               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.GUITOOLANDWEAPONCRAFTINGTEXTURE));
+               this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(ChemiCraft.instance.guiToolAndWeaponCraftingTexture));
                this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
        }
 
index ada8aa4..fab443c 100644 (file)
@@ -109,5 +109,4 @@ public class InventoryPyrolysisTableMaterial implements IInventory {
        @Override
        public void closeChest() {
        }
-
 }
index f8ca9fd..ea14e17 100644 (file)
@@ -94,6 +94,7 @@ public class InventoryPyrolysisTableResult implements IInventory {
 
        @Override
        public void onInventoryChanged() {
+               if(this.eventHandler != null) this.eventHandler.onCraftMatrixChanged(this);
        }
 
        @Override
@@ -108,5 +109,4 @@ public class InventoryPyrolysisTableResult implements IInventory {
        @Override
        public void closeChest() {
        }
-
 }
index 3ec489c..b766426 100644 (file)
@@ -43,7 +43,7 @@ public class ItemAtoms extends Item {
 
        @Override
        public String getTextureFile(){
-               return ChemiCraft.instance.ITEMATOMSTEXTURE;
+               return ChemiCraft.instance.itemAtomsTexture;
        }
 
 
index 8628675..18df605 100644 (file)
@@ -79,7 +79,7 @@ public class ItemCompounds extends Item {
 
        @Override
        public String getTextureFile(){
-               return ChemiCraft.instance.ITEMCOMPOUNDSTEXTURE;
+               return ChemiCraft.instance.itemCompoundsTexture;
        }
 
 
index 2547632..fd8cca2 100644 (file)
@@ -56,6 +56,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                // デバッグ用
                if (par2World.isRemote) {
                        par3EntityPlayer.addChatMessage("result1=" + result1 + " result2=" + result2 + " result3=" + result3);
+                       par3EntityPlayer.addChatMessage("このメッセージは開発版のみの表示ですが、もし製品版で表示されていた場合はご連絡ください。");
                }
 
                return par1ItemStack;
@@ -80,7 +81,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                if (uniqueBlock instanceof BlockFire){
                        par1ItemStack.damageItem(1, par2EntityPlayer);
 
-                       int result1 = MathHelperPlus.probability(99, 1);
+                       int result1 = MathHelperPlus.probability(90, 10);
 
                        if (result1 == 0) {
                                this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par2EntityPlayer);
index d8b549d..916a86f 100644 (file)
@@ -30,7 +30,7 @@ public class RenderAtomsGrenade extends Render {
                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);
+               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;
index 0d9ae9a..fb83ba6 100644 (file)
@@ -5,8 +5,8 @@ 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);
+       public SlotPyrolysisTableMaterial(IInventory par1IInventory, int par2, int par3, int par4) {
+               super(par1IInventory, par2, par3, par4);
        }
 
 }
index 29412ea..41d25e0 100644 (file)
@@ -6,12 +6,12 @@ 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);
+       public SlotPyrolysisTableResult(IInventory par1IInventory, int par2, int par3, int par4) {
+               super(par1IInventory, par2, par3, par4);
        }
 
-       @Override
-       public boolean isItemValid(ItemStack par1ItemStack){
+       public boolean isItemValid(ItemStack par1ItemStack)
+       {
                return false;
        }
 
index 58f4c0a..7edcb3a 100644 (file)
@@ -5,11 +5,13 @@ import net.minecraft.tileentity.TileEntity;
 import net.minecraft.world.World;
 import chemicraft.container.ContainerChemicalCombinationTable;
 import chemicraft.container.ContainerChemicalCraftingTable;
+import chemicraft.container.ContainerElectrolysisTable;
 import chemicraft.container.ContainerPyrolysisTable;
 import chemicraft.container.ContainerToolAndWeaponCraftingTable;
 import chemicraft.debug.DebugTick;
 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
 import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityElectrolysisTable;
 import chemicraft.tileentity.TileEntityPyrolysisTable;
 import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 import cpw.mods.fml.common.network.IGuiHandler;
@@ -32,14 +34,16 @@ public class CommonProxy implements IGuiHandler {
                        return null;
 
                TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
-               if (tileEntity instanceof TileEntityPyrolysisTable) {
-                       return new ContainerPyrolysisTable(player, (TileEntityPyrolysisTable) tileEntity);
-               }else if(tileEntity instanceof TileEntityChemicalCombinationTable){
+               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);
+               }else if(tileEntity instanceof TileEntityElectrolysisTable){
+                       return new ContainerElectrolysisTable(player, (TileEntityElectrolysisTable)tileEntity);
+               } else if(tileEntity instanceof TileEntityPyrolysisTable) {
+                       return new ContainerPyrolysisTable(player, (TileEntityPyrolysisTable)tileEntity);
                }
                return null;
        }
index 40fd89e..9a451cb 100644 (file)
@@ -11,8 +11,6 @@ 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;
@@ -20,10 +18,6 @@ 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();
@@ -93,7 +87,7 @@ public class TileEntityPyrolysisTable extends TileEntity {
                                } else if (this.worldObj.isThundering() && var1) {
                                        this.heat += 0.25F;
                                } else {
-                                       this.heat += 3F;
+                                       this.heat += 0.5F;
                                }
                        } else {
                                this.heat = 1700;
@@ -127,7 +121,7 @@ public class TileEntityPyrolysisTable extends TileEntity {
                                                //var2 = true;
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
                                                        this.inItem(itemstackMaterial);
-                                                       if (materialItem.stackSize >= 1) {
+                                                       if (materialItem.stackSize > 1) {
                                                                this.invm.setInventorySlotContents(0, new ItemStack(materialItem.itemID, --materialItem.stackSize, materialItem.getItemDamage()));
                                                        } else {
                                                                this.invm.setInventorySlotContents(0, null);
@@ -159,7 +153,7 @@ public class TileEntityPyrolysisTable extends TileEntity {
                                                                        if (fuelItem != null) {
                                                                                if (itemstackFuel.itemID == fuelItem.itemID && itemstackFuel.getItemDamage() == fuelItem.getItemDamage()) {
                                                                                        this.fuelRestTime = fuelList.get(itemstackFuel);
-                                                                                       if (fuelItem.stackSize >= 1) {
+                                                                                       if (fuelItem.stackSize > 1) {
                                                                                                this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
                                                                                                break;
                                                                                        } else {
@@ -423,8 +417,8 @@ public class TileEntityPyrolysisTable extends TileEntity {
        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 j = 0; j < this.invr.getSizeInventory(); j++) {
+                       containerResults[j] = this.invr.getStackInSlot(j);
                }
 
                for (int i = 0; i < results.length; i++) {
@@ -433,6 +427,7 @@ public class TileEntityPyrolysisTable extends TileEntity {
                        int var5 = results[i].stackSize;
                        for (int j = 0; j < containerResults.length; j++) {
                                if (containerResults[j] == null) {
+                                       containerResults[j] = results[i];
                                        results[i] = null;
                                        break;
                                } else {
@@ -442,6 +437,7 @@ public class TileEntityPyrolysisTable extends TileEntity {
                                        int var7 = containerResults[j].getMaxStackSize();
                                        if (var1 == var2 && var3 == var4) {
                                                if (var5 + var6 <= var7) {
+                                                       containerResults[j] = results[i];
                                                        results[i] = null;
                                                        break;
                                                } else {
@@ -461,12 +457,12 @@ public class TileEntityPyrolysisTable extends TileEntity {
 
        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++) {
+                       ItemStack[] containerResults = new ItemStack[this.invr.getSizeInventory()];
+                       for (int j = 0; j < this.invr.getSizeInventory(); j++) {
+                               containerResults[j] = this.invr.getStackInSlot(j);
+                       }
                        int var1 = results[i].itemID;
                        int var3 = results[i].getItemDamage();
                        int var5 = results[i].stackSize;
@@ -481,11 +477,6 @@ public class TileEntityPyrolysisTable extends TileEntity {
                                        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 {
index 44bc07e..32d3adc 100644 (file)
@@ -3,11 +3,16 @@ package chemicraft.tileentity;
 import java.io.DataOutputStream;
 
 import net.minecraft.tileentity.TileEntity;
+import chemicraft.inventory.InventoryToolAndWeaponCraftingTableMaterial;
+import chemicraft.inventory.InventoryToolAndWeaponCraftingTableResult;
 
 import com.google.common.io.ByteArrayDataInput;
 
 public class TileEntityToolAndWeaponCraftingTable extends TileEntity {
 
+       public InventoryToolAndWeaponCraftingTableMaterial invm = new InventoryToolAndWeaponCraftingTableMaterial();
+       public InventoryToolAndWeaponCraftingTableResult invr = new InventoryToolAndWeaponCraftingTableResult();
+
        public void readPacket(ByteArrayDataInput data) {
                try {
                } catch (Exception e) {