OSDN Git Service

変更点をそのままにして修正し、間違っているところを消去&修正
authormozipi <mozipi@users.sourceforge.jp>
Wed, 5 Dec 2012 18:26:33 +0000 (03:26 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Wed, 5 Dec 2012 18:39:13 +0000 (03:39 +0900)
18 files changed:
common/chemicraft/AtomInfo.java
common/chemicraft/Auxiliary.java
common/chemicraft/BlockScienceCraftingTable.java [new file with mode: 0644]
common/chemicraft/ChemiCraft.java
common/chemicraft/ChemiCraftAPI.java
common/chemicraft/ChemiCraftTabs.java [new file with mode: 0644]
common/chemicraft/CommonProxy.java
common/chemicraft/CompoundHandlerTest.java
common/chemicraft/ContainerScienceCraftingTable.java [new file with mode: 0644]
common/chemicraft/CreativeTabAtoms.java
common/chemicraft/GuiScienceCraftingTable.java [new file with mode: 0644]
common/chemicraft/ICompoundHandler.java
common/chemicraft/ItemAtoms.java
common/chemicraft/ItemCompounds.java
common/chemicraft/ItemGasCollectingBottle.java
common/chemicraft/TileEntityDecompose.java [deleted file]
common/chemicraft/TileEntityScienceCraftingTable.java [new file with mode: 0644]
src/chemicraft/client/ClientProxy.java

index f11ef33..9523468 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;\r
+package chemicraft;\r
 \r
 import net.minecraft.src.EntityPlayer;\r
 import net.minecraft.src.ItemStack;\r
@@ -16,29 +16,29 @@ public class AtomInfo {
 \r
                this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;\r
 \r
-               this.posX = (int) par2EntityPlayer.posX; // X座標\r
-               this.posY = (int) par2EntityPlayer.posY; // Y座標\r
-               this.posZ = (int) par2EntityPlayer.posZ; // Z座標\r
+               this.posX = (int) par2EntityPlayer.posX; // X\8dÀ\95W\r
+               this.posY = (int) par2EntityPlayer.posY; // Y\8dÀ\95W\r
+               this.posZ = (int) par2EntityPlayer.posZ; // Z\8dÀ\95W\r
 \r
                boolean rainy = par1World.isRaining();\r
                boolean thunder = par1World.isThundering();\r
-               if (rainy && thunder){ // 雨且つ雷\r
+               if (rainy && thunder){ // \89J\8a\8e\82Â\97\8b\r
                        this.weather = "THUNDER";\r
-               }else if(rainy){ // 雨または雪\r
+               }else if(rainy){ // \89J\82Ü\82½\82Í\90á\r
                        this.weather = "RAINY";\r
-               }else{ //晴れ\r
+               }else{ //\90°\82ê\r
                        this.weather = "SUNNY";\r
                }\r
        }\r
 \r
        /**\r
-        * Y座標との比較\r
+        * Y\8dÀ\95W\82Æ\82Ì\94ä\8ar\r
         * @param EntityPlayer EntityPlayer\r
-        * @param y Y座標\r
-        * @param biomeName バイオームの名前(nullでも可)\r
-        * @param weather 天気(nullでも可)\r
-        * @param par1 入手数\r
-        * @param par2 種類(ダメージ値)\r
+        * @param y Y\8dÀ\95W\r
+        * @param biomeName \83o\83C\83I\81[\83\80\82Ì\96¼\91O(null\82Å\82à\89Â)\r
+        * @param weather \93V\8bC(null\82Å\82à\89Â)\r
+        * @param par1 \93ü\8eè\90\94\r
+        * @param par2 \8eí\97Þ(\83_\83\81\81[\83W\92l)\r
         */\r
        private boolean equivalentBiome(String biomeName){\r
                boolean ver1 = biomeName != null ? ((this.biomeName == biomeName) ? true : false) : true;\r
index 6a88b97..946bb34 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;\r
+package chemicraft;\r
 \r
 import net.minecraft.src.Block;\r
 import net.minecraft.src.Item;\r
@@ -13,7 +13,7 @@ public class Auxiliary {
        class NameAuxiliary{\r
 \r
                /**\r
-                * 名前を追加する。\r
+                * \96¼\91O\82ð\92Ç\89Á\82·\82é\81B\r
                 * @param object\r
                 * @param Name\r
                 */\r
@@ -22,7 +22,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * 名前を追加する(ItemStack版)\r
+                * \96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)\r
                 * @param object\r
                 * @param name\r
                 * @param meta\r
@@ -30,10 +30,10 @@ public class Auxiliary {
                public void addName(ItemStack itemstack,Object name){\r
                        LanguageRegistry.addName(itemstack, (String) name);\r
                }\r
-               \r
+\r
 \r
                /**\r
-                * 指定した言語で名前を追加する。\r
+                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é\81B\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -42,7 +42,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * 指定した言語で名前を追加する(ItemStack版)\r
+                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -52,7 +52,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * メタデータ+配列で名前を追加する(Block版)\r
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Block\94Å)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -63,7 +63,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * メタデータ+配列で名前を追加する(Item版)\r
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Item\94Å)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -74,7 +74,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * メタデータ+配列で指定した言語で名前を追加する(Block版)\r
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Block\94Å)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -85,7 +85,7 @@ public class Auxiliary {
                }\r
 \r
                /**\r
-                * メタデータ+配列で指定した言語で名前を追加する(Item版)\r
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Item\94Å)\r
                 * @param object\r
                 * @param name\r
                 */\r
diff --git a/common/chemicraft/BlockScienceCraftingTable.java b/common/chemicraft/BlockScienceCraftingTable.java
new file mode 100644 (file)
index 0000000..d5d1de7
--- /dev/null
@@ -0,0 +1,30 @@
+package chemicraft;
+
+import cpw.mods.fml.common.Mod;
+import net.minecraft.src.BlockContainer;
+import net.minecraft.src.CreativeTabs;
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.Material;
+import net.minecraft.src.TileEntity;
+import net.minecraft.src.World;
+
+public class BlockScienceCraftingTable extends BlockContainer {
+
+       public BlockScienceCraftingTable(int par1, int par2, Material par3Material) {
+               super(par1, par2, par3Material);
+               this.setCreativeTab(CreativeTabs.tabBlock);
+       }
+
+       @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.guiScienceCraftingTableID, par1World, par2, par3, par4);
+        return true;
+    }
+
+       @Override
+       public TileEntity createNewTileEntity(World var1) {
+               return new TileEntityScienceCraftingTable();
+       }
+
+}
index f9ea799..d727bb9 100644 (file)
@@ -1,23 +1,19 @@
 package chemicraft;\r
 \r
-import java.util.ArrayList;\r
-import java.util.Properties;\r
-\r
 import net.minecraft.src.Block;\r
 import net.minecraft.src.CreativeTabs;\r
 import net.minecraft.src.Item;\r
-import net.minecraft.src.ItemStack;\r
+import net.minecraft.src.Material;\r
 import net.minecraftforge.common.Configuration;\r
 import net.minecraftforge.common.Property;\r
+import chemicraft.Auxiliary.NameAuxiliary;\r
 import cpw.mods.fml.common.Mod;\r
-import cpw.mods.fml.common.Mod.Instance;\r
 import cpw.mods.fml.common.SidedProxy;\r
-import cpw.mods.fml.common.event.FMLInitializationEvent;\r
 import cpw.mods.fml.common.event.FMLPostInitializationEvent;\r
 import cpw.mods.fml.common.event.FMLPreInitializationEvent;\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
-import cpw.mods.fml.common.registry.LanguageRegistry;\r
 \r
 @Mod( modid = "chemiCraft", name="ChemiCraft", version="テスト版") //ID,名前,バージョン\r
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "[1.3.2]", packetHandler = PacketHandler.class) //クライアント、サーバー共に必要 1.3.2用\r
@@ -25,8 +21,6 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
 public class ChemiCraft\r
 {\r
 \r
-       public static final CreativeTabs tabAtoms = new CreativeTabAtoms("tabAtoms");\r
-\r
        public static final String[] atomsName = {\r
                "Hydrogen", "Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon",\r
                "Sodium","Magnesium","Aluminium","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium",\r
@@ -54,68 +48,118 @@ public class ChemiCraft
                "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン", "フランシウム", "ラジウム", "アクチニウム", "トリウム",\r
                "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム",\r
                "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム", "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム",\r
-               "ã\83¬ã\83³ã\83\88ã\82²ã\83\8bã\82¦ã\83 ", "ã\82³ã\83\9aã\83«ã\83\8bã\82·ã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\83\88ã\83ªã\82¦ã\83 ", "ã\83\95ã\83¬ã\83­ã\83\93ã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\83\9aã\83³ã\83\81ã\82¦ã\83 ", "ã\83ªã\83\90ã\83¢ã\83ªã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\82»ã\83\97ã\83\81ã\82¦ã\83 ", "ウンウンオクチウム"\r
+               "ã\83¬ã\83³ã\83\88ã\82²ã\83\8bã\82¦ã\83 ", "ã\82³ã\83\9aã\83«ã\83\8bã\82·ã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\83\88ã\83ªã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\82¯ã\82¢ã\82¸ã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\83\9aã\83³ã\83\81ã\82¦ã\83 ", "ã\82¦ã\83³ã\82¦ã\83³ã\83\98ã\82­ã\82·ã\82¦ã\83 ", "", "ウンウンオクチウム"\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.CommonProxy")\r
        public static CommonProxy proxy;\r
-       \r
-       // このクラスのインスタンス\r
-       @Instance("chemiCraft")\r
-       public static ChemiCraft instance;\r
-       \r
-       private ChemiCraftAPI chemiCraftAPI = ChemiCraftAPI.instance;\r
 \r
-       public static int gasCollectingBottleID;\r
+       /**\r
+        * ChemiCraftのCreativeTab\r
+        */\r
+       public static CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");\r
+\r
+       /**\r
+        * ItemID\r
+        */\r
        public static int atomsID;\r
        public static int compoundsID;\r
+       public static int gasCollectingBottleID;\r
 \r
-       public static Item itemGasCollectingBottle;\r
-       public static Item itemAtoms;\r
-       public static Item itemCompounds;\r
+       /**\r
+        * BlockID\r
+        */\r
+       public static int scienceCraftingTableID;\r
 \r
-       private Auxiliary Auxiliary = new Auxiliary();\r
-       private Auxiliary.NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
+       /**\r
+        * GUIID\r
+        */\r
+       public static int guiScienceCraftingTableID;\r
 \r
-       // コンストラクタ\r
-       @Mod.Init\r
-       public void chemiLoadMethod(FMLInitializationEvent event)\r
-       {\r
+       /**\r
+        * Block型変数\r
+        */\r
+       public static Block blockScienceCraftingTable;\r
 \r
-               //化合物の追加\r
-               ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "塩");\r
-       }\r
+       /**\r
+        * Item型変数\r
+        */\r
+       public static Item itemAtoms;\r
+       public static Item itemCompounds;\r
+       public static Item itemGasCollectingBottle;\r
+\r
+       /**\r
+        * このmodに必要な補助クラスのインスタンス\r
+        */\r
+       private static Auxiliary Auxiliary = new Auxiliary();\r
+       private static NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
 \r
-       @Mod.PreInit  // 前処理\r
+       @Mod.PreInit\r
        public void chemiPreLoadMethod(FMLPreInitializationEvent event)\r
        {\r
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
                cfg.load();\r
-               Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25000);\r
-               Property atomsIDProp = cfg.getItem("atomsID", 25001);\r
-               Property compoundsIDProp = cfg.getItem("compoundsID", 25002);\r
-               gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
+\r
+               Property scienceCraftingTableIDProp = cfg.getBlock("scienceCraftingTable", 200);\r
+               Property atomsIDProp = cfg.getItem("atomsID", 25000);\r
+               Property compoundsIDProp = cfg.getItem("compoundsID", 25001);\r
+               Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);\r
+               Property guiScienceCraftingTableIDProp = cfg.get("GUI", "GUIScienceCraftingTableID", 1000);\r
+\r
+               scienceCraftingTableID = scienceCraftingTableIDProp.getInt();\r
                atomsID = atomsIDProp.getInt();\r
                compoundsID = compoundsIDProp.getInt();\r
+               gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
+               guiScienceCraftingTableID = guiScienceCraftingTableIDProp.getInt();\r
+\r
                cfg.save();\r
        }\r
 \r
-       @Mod.PostInit // ModLoader.loadメソッドと同等\r
+       @Mod.PostInit\r
        public void chemiPostLoadMethod(FMLPostInitializationEvent event)\r
        {\r
-               itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");\r
+               //API用の処理\r
+               NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
+               NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
+\r
+               //Blockを追加します\r
+               blockScienceCraftingTable = new BlockScienceCraftingTable(scienceCraftingTableID, Block.workbench.blockIndexInTexture, Material.ground).setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ScienceCraftingTable");\r
+\r
+               //Itemを追加します\r
                itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
                itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");\r
+               itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");\r
+\r
+               //BlockをMinecraftに登録します\r
+               GameRegistry.registerBlock(blockScienceCraftingTable);\r
 \r
+               //Blockの名前を設定します\r
+               NameAuxiliary.addName(blockScienceCraftingTable, "ScienceCraftingTable");\r
+               NameAuxiliary.addName(blockScienceCraftingTable, "ja_JP", "科学作業台");\r
+\r
+               //Itemの名前を設定します\r
                NameAuxiliary.addName(itemAtoms, atomsName);\r
                NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP);\r
-               NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
-               NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
                NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle");\r
                NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "集気瓶");\r
 \r
-               ChemiCraftAPI.addCompoundHandler("Salt", new CompoundHandlerTest());\r
+               //化合物の名前を設定し追加します\r
+               ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "塩");\r
+\r
+               //TileEntityを追加します\r
+               GameRegistry.registerTileEntity(TileEntityScienceCraftingTable.class, "TileEntityScienceCraftingTable");\r
+\r
+               //GUIを追加します\r
+               NetworkRegistry.instance().registerGuiHandler(instance, proxy);\r
 \r
        }\r
 \r
index 5630753..5f1a892 100644 (file)
@@ -1,50 +1,73 @@
-package chemicraft;
+package chemicraft;
 
 import java.util.ArrayList;
 
 public class ChemiCraftAPI {
 
+       /**
+        * Instance of the ChemiCraftAPI.
+        */
        public static ChemiCraftAPI instance = new ChemiCraftAPI();
 
-       private boolean addLanguage = false;
+       /**
+        * List of compounds names.
+        */
        private static ArrayList<String> compoundsNameList = new ArrayList();
+
+       /**
+        * List of compounds names(Some kind of language).
+        */
        private static ArrayList<String> compoundsLangNameList = new ArrayList();
+
+       /**
+        * List of compounds the language names.
+        */
        private static ArrayList<String> compoundsLangList = new ArrayList();
+
+       /**
+        * List of compounds handlers.
+        */
        private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
+
+       /**
+        * List of item name of handler to compounds.
+        */
        private static ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
 
+       /**
+        * add compound.
+        * @param name compound name.
+        */
        public static void addCompound(String name){
                compoundsNameList.add(name);
                compoundsLangNameList.add("");
                compoundsLangList.add("");
        }
 
+       /**
+        * add compound corresponding to the language.
+        * @param lang Language to the corresponding
+        * @param englishName compound name
+        * @param langName compound name(specified language)
+        */
        public static void addLangCompound(String lang, String englishName, String langName){
                compoundsNameList.add(englishName);
                compoundsLangNameList.add(langName);
                compoundsLangList.add(lang);
        }
 
-       public static ArrayList<String> getCompoundsName(){
-               compoundsNameList.trimToSize();
-               return compoundsNameList;
-       }
-
-       public static ArrayList<String> getCompoundsLangName(){
-               compoundsLangNameList.trimToSize();
-               return compoundsLangNameList;
-       }
-
-       public static ArrayList<String> getCompoundsLang(){
-               compoundsLangList.trimToSize();
-               return compoundsLangList;
-       }
-
-       public static void addCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
+       /**
+        * setting compound handler.
+        * @param handlerItemName
+        * @param compoundHandler
+        */
+       public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
                ChemiCraftAPI.compoundHandlers.add(compoundHandler);
                compoundHandlerItemNames.add(handlerItemName);
        }
 
+       //\88È\8d~\83V\83X\83e\83\80\8aÖ\8cW\82Ì\83\81\83\\83b\83h//////////////////////////////////////////////////////
+
        public static ArrayList<ICompoundHandler> getCompoundHandler(){
                compoundHandlers.trimToSize();
                return compoundHandlers;
@@ -56,4 +79,19 @@ public class ChemiCraftAPI {
                return compoundHandlerItemNames;
        }
 
+       public static ArrayList<String> getCompoundsName(){
+               compoundsNameList.trimToSize();
+               return compoundsNameList;
+       }
+
+       public static ArrayList<String> getCompoundsLangName(){
+               compoundsLangNameList.trimToSize();
+               return compoundsLangNameList;
+       }
+
+       public static ArrayList<String> getCompoundsLang(){
+               compoundsLangList.trimToSize();
+               return compoundsLangList;
+       }
+
 }
diff --git a/common/chemicraft/ChemiCraftTabs.java b/common/chemicraft/ChemiCraftTabs.java
new file mode 100644 (file)
index 0000000..0840ee5
--- /dev/null
@@ -0,0 +1,58 @@
+package chemicraft;
+
+public class ChemiCraftTabs {
+
+       /**
+        * tab\82ÌID
+        */
+       private int id;
+
+       /**
+        * tab\82ÉOverlay\82·\82éTextureID
+        */
+       private int texture;
+
+
+
+       /**
+        * tab\82Ì\96¼\91O
+        */
+       private String tabName;
+
+       public ChemiCraftTabs(int id, int texture, String tabName){
+               this.id = id;
+               this.texture = texture;
+               this.tabName = tabName;
+       }
+
+
+
+       /**
+        * ID\82ð\95Ô\82µ\82Ü\82·
+        * @return tab\82ÌID
+        */
+       public int getID(){
+               return this.id;
+       }
+
+
+
+       /**
+        * tab\82ÉOverlay\82·\82éTextureID\82ð\95Ô\82µ\82Ü\82·
+        * @return tab\82ÉOverlay\82·\82éTextureID
+        */
+       public int getTexture(){
+               return this.texture;
+       }
+
+
+
+       /**
+        * tab\82Ì\96¼\91O\82ð\95Ô\82µ\82Ü\82·
+        * @return tab\82Ì\96¼\91O
+        */
+       public String getTabName(){
+               return this.tabName;
+       }
+
+}
index 1dcc5a3..3608d31 100644 (file)
@@ -28,4 +28,4 @@ public class CommonProxy implements IGuiHandler
        {
                return null;
        }
-}
+}
\ No newline at end of file
index 5f10799..e13d149 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import net.minecraft.src.Entity;
 import net.minecraft.src.EntityPlayer;
diff --git a/common/chemicraft/ContainerScienceCraftingTable.java b/common/chemicraft/ContainerScienceCraftingTable.java
new file mode 100644 (file)
index 0000000..06c739e
--- /dev/null
@@ -0,0 +1,61 @@
+package chemicraft;
+
+import net.minecraft.src.Block;
+import net.minecraft.src.Container;
+import net.minecraft.src.CraftingManager;
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.IInventory;
+import net.minecraft.src.InventoryCraftResult;
+import net.minecraft.src.InventoryCrafting;
+import net.minecraft.src.InventoryPlayer;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.Slot;
+import net.minecraft.src.SlotCrafting;
+import net.minecraft.src.World;
+
+public class ContainerScienceCraftingTable extends Container
+{
+    private World worldObj;
+    private int posX;
+    private int posY;
+    private int posZ;
+
+    public ContainerScienceCraftingTable(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
+    {
+        this.worldObj = par2World;
+        this.posX = par3;
+        this.posY = par4;
+        this.posZ = par5;
+        int var6;
+        int var7;
+
+    }
+
+    /**
+     * Callback for when the crafting matrix is changed.
+     */
+    public void onCraftMatrixChanged(IInventory par1IInventory)
+    {
+    }
+
+    /**
+     * Callback for when the crafting gui is closed.
+     */
+    public void onCraftGuiClosed(EntityPlayer par1EntityPlayer)
+    {
+        super.onCraftGuiClosed(par1EntityPlayer);
+    }
+
+    public boolean canInteractWith(EntityPlayer par1EntityPlayer)
+    {
+        return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.scienceCraftingTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
+    }
+
+    /**
+     * Called to transfer a stack from one inventory to the other eg. when shift clicking.
+     */
+    public ItemStack transferStackInSlot(int par1)
+    {
+        return null;
+    }
+}
index fac365d..21a9948 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import net.minecraft.src.*;
 import cpw.mods.fml.common.Side;
@@ -17,7 +17,7 @@ public class CreativeTabAtoms extends CreativeTabs{
        {
                return ChemiCraft.itemGasCollectingBottle.shiftedIndex;
        }
+
        @Override
        @SideOnly(Side.CLIENT)
        public String getTranslatedTabLabel()
diff --git a/common/chemicraft/GuiScienceCraftingTable.java b/common/chemicraft/GuiScienceCraftingTable.java
new file mode 100644 (file)
index 0000000..1e340e5
--- /dev/null
@@ -0,0 +1,65 @@
+package chemicraft;
+
+import java.util.ArrayList;
+
+import net.minecraft.src.GuiContainer;
+import net.minecraft.src.InventoryPlayer;
+import net.minecraft.src.MinecraftException;
+import net.minecraft.src.World;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.common.Side;
+import cpw.mods.fml.common.asm.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class GuiScienceCraftingTable extends GuiContainer
+{
+
+       private ArrayList<ChemiCraftTabs> tabList = new ArrayList<ChemiCraftTabs>();
+
+       public GuiScienceCraftingTable(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
+       {
+               super(new ContainerScienceCraftingTable(par1InventoryPlayer, par2World, par3, par4, par5));
+       }
+
+       @Override
+       protected void drawGuiContainerForegroundLayer()
+       {
+               //this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 28, 6, 4210752);
+               //this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+       }
+
+       @Override
+       protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+       {
+               int var4 = this.mc.renderEngine.getTexture("/ChemiCraft/guis/Decomposition.png");
+               int var7 = this.mc.renderEngine.getTexture("/gui/allitems.png");
+               GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+               this.mc.renderEngine.bindTexture(var4);
+               int var5 = (this.width - this.xSize) / 2;
+               int var6 = (this.height - this.ySize) / 2;
+               this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
+
+               for(int i = 0;i < tabList.size();i++){
+                       this.mc.renderEngine.bindTexture(var7);
+                       int var8 = var5 + tabList.get(i).getID() * 28;
+                       int var9 = var6 - 32;
+                       this.drawTexturedModalRect(var8, var9, 0, 0, 28, 32);
+               }
+       }
+
+       private void addTabs(int id, int Texture, String name){
+               for(int i = 0;i < tabList.size();i++){
+                       if(id == tabList.get(i).getID()){
+                               try {
+                                       throw new Exception("ChemiCraft\93à\82Å\83G\83\89\81[:ChemiCraftTabs\82ÌID\82ª\8fd\95¡\82µ\82Ä\82¢\82Ü\82·");
+                               } catch (Exception e) {
+                                       e.printStackTrace();
+                               }
+                       }
+               }
+               tabList.add(new ChemiCraftTabs(id, Texture, name));
+       }
+
+}
index c542618..3e69c18 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import net.minecraft.src.Entity;
 import net.minecraft.src.EntityPlayer;
index 94cc019..12d9469 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import java.util.List;
 
@@ -17,7 +17,7 @@ public class ItemAtoms extends Item {
         this.maxStackSize = 1;
         this.setHasSubtypes(true);
         this.setMaxDamage(0);
-        this.setCreativeTab(ChemiCraft.tabAtoms);
+        this.setCreativeTab(ChemiCraft.instance.creativeTab);
     }
 
     @SideOnly(Side.CLIENT)
@@ -41,7 +41,7 @@ public class ItemAtoms extends Item {
     public String getTextureFile()
     {
         this.isDefaultTexture = false;
-        return "/ChemiCraft/Atoms.png";
+        return "/ChemiCraft/items/Atoms.png";
     }
 
     @SideOnly(Side.CLIENT)
index dc381ba..dfdeb0e 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import java.util.List;
 
@@ -17,7 +17,7 @@ public class ItemCompounds extends Item {
                this.maxStackSize = 1;
                this.setHasSubtypes(true);
                this.setMaxDamage(0);
-               this.setCreativeTab(ChemiCraft.tabAtoms);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
        }
 
        @Override
@@ -52,7 +52,7 @@ public class ItemCompounds extends Item {
        public String getTextureFile()
        {
                this.isDefaultTexture = false;
-               return "/ChemiCraft/Compounds.png";
+               return "/ChemiCraft/items/Compounds.png";
        }
 
        @SideOnly(Side.CLIENT)
index 60547a0..26f3201 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;
+package chemicraft;
 
 import java.util.Random;
 
@@ -6,11 +6,11 @@ import net.minecraft.src.*;
 
 public class ItemGasCollectingBottle extends Item {
 
-       protected ItemGasCollectingBottle(int id) {
+       public ItemGasCollectingBottle(int id) {
                super(id);
                this.setMaxStackSize(1);
                this.setMaxDamage(2);
-               this.setCreativeTab(ChemiCraft.tabAtoms);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
        }
 
        @Override
@@ -26,7 +26,7 @@ public class ItemGasCollectingBottle extends Item {
     public String getTextureFile()
     {
         this.isDefaultTexture = false;
-        return "/ChemiCraft/items.png";
+        return "/ChemiCraft/items/sprite.png";
     }
 
 }
diff --git a/common/chemicraft/TileEntityDecompose.java b/common/chemicraft/TileEntityDecompose.java
deleted file mode 100644 (file)
index f8ab952..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package chemicraft;\r
-\r
-import net.minecraft.src.EntityPlayer;\r
-import net.minecraft.src.IInventory;\r
-import net.minecraft.src.ItemStack;\r
-import net.minecraft.src.TileEntity;\r
-\r
-public class TileEntityDecompose extends TileEntity implements IInventory\r
-{\r
-       // 0:物質アイテム 1~:原子アイテム\r
-       private ItemStack[] invContents;\r
-       \r
-       public TileEntityDecompose()\r
-       {\r
-               invContents = new ItemStack[36];\r
-       }\r
-\r
-       @Override\r
-       public int getSizeInventory()\r
-       {\r
-               return 17;\r
-       }\r
-\r
-       @Override\r
-       public ItemStack getStackInSlot(int var1)\r
-       {\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public ItemStack decrStackSize(int var1, int var2)\r
-       {\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public ItemStack getStackInSlotOnClosing(int var1)\r
-       {\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public void setInventorySlotContents(int var1, ItemStack var2)\r
-       {\r
-               \r
-       }\r
-\r
-       @Override\r
-       public String getInvName()\r
-       {\r
-               return null;\r
-       }\r
-\r
-       @Override\r
-       public int getInventoryStackLimit()\r
-       {\r
-               return 0;\r
-       }\r
-\r
-       @Override\r
-       public boolean isUseableByPlayer(EntityPlayer var1)\r
-       {\r
-               return false;\r
-       }\r
-\r
-       @Override\r
-       public void openChest()\r
-       {\r
-               \r
-       }\r
-\r
-       @Override\r
-       public void closeChest()\r
-       {\r
-               \r
-       }\r
-}\r
diff --git a/common/chemicraft/TileEntityScienceCraftingTable.java b/common/chemicraft/TileEntityScienceCraftingTable.java
new file mode 100644 (file)
index 0000000..e8ac3ca
--- /dev/null
@@ -0,0 +1,27 @@
+package chemicraft;
+
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.IInventory;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.NBTTagCompound;
+import net.minecraft.src.Packet;
+import net.minecraft.src.TileEntity;
+
+public class TileEntityScienceCraftingTable extends TileEntity {
+
+       public TileEntityScienceCraftingTable(){
+       }
+
+       @Override
+       public void updateEntity(){
+               super.updateEntity();
+       }
+
+       @Override
+       public void readFromNBT(NBTTagCompound par1){
+       }
+
+       @Override
+       public void writeToNBT(NBTTagCompound par1){
+       }
+}
index 66d8dbb..4bdf5e1 100644 (file)
@@ -1,9 +1,9 @@
 package chemicraft.client;
 
-import cpw.mods.fml.client.FMLClientHandler;
 import net.minecraft.src.EntityPlayer;
 import net.minecraft.src.World;
 import chemicraft.CommonProxy;
+import cpw.mods.fml.client.FMLClientHandler;
 
 public class ClientProxy extends CommonProxy
 {