OSDN Git Service

命名が間違っているクラスがあったので修正
authormozipi <mozipi@users.sourceforge.jp>
Sat, 8 Dec 2012 21:35:10 +0000 (06:35 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Sat, 8 Dec 2012 21:52:08 +0000 (06:52 +0900)
AtomInfo.javaのコードが完全にスパゲッティーだったのでもうビフォーアフターした
AtomInfo.javaを使う場合はItemAtomInfoContainerを継承してください
機能を使う前にAtomInfo.update(World, EntityPlayer);を呼び出してください
コードスタイルをすべて統一しておきました
グローバル変数は2行空け(変数群は除く)、メソッドは3行空けにしておいた

20 files changed:
common/chemicraft/AtomInfo.java
common/chemicraft/Auxiliary.java
common/chemicraft/BlockScienceCraftingTable.java
common/chemicraft/ChemiCraft.java
common/chemicraft/ChemiCraftAPI.java
common/chemicraft/ChemiCraftTab.java [new file with mode: 0644]
common/chemicraft/ChemiCraftTabs.java [deleted file]
common/chemicraft/CommonProxy.java
common/chemicraft/CompoundHandlerTest.java
common/chemicraft/ContainerScienceCraftingTable.java
common/chemicraft/CreativeTabAtoms.java
common/chemicraft/GuiScienceCraftingTable.java
common/chemicraft/ICompoundHandler.java
common/chemicraft/ItemAtomInfoContainer.java [new file with mode: 0644]
common/chemicraft/ItemAtoms.java
common/chemicraft/ItemCompounds.java
common/chemicraft/ItemGasCollectingBottle.java
common/chemicraft/PacketHandler.java
common/chemicraft/TileEntityScienceCraftingTable.java
src/chemicraft/client/ClientProxy.java

index 9523468..73630f5 100644 (file)
@@ -6,87 +6,144 @@ import net.minecraft.src.World;
 \r
 public class AtomInfo {\r
 \r
-       protected static int posX;\r
-       protected static int posY;\r
-       protected static int posZ;\r
-       protected static String biomeName;\r
-       protected static String weather;\r
+       /**\r
+        * X, Y, Z座標\r
+        */\r
+       private  int posX;\r
+       private  int posY;\r
+       private  int posZ;\r
+\r
+\r
+       /**\r
+        * biomeの名前\r
+        */\r
+       private  String biomeName;\r
+\r
 \r
-       public AtomInfo(World par1World, EntityPlayer par2EntityPlayer){\r
+       /**\r
+        * 天候\r
+        */\r
+       private  String weather;\r
+\r
+\r
+       /**\r
+        * EntityPlayerのインスタンス\r
+        */\r
+       private EntityPlayer entityPlayer;\r
+\r
+\r
+       /**\r
+        * Worldのインスタンス\r
+        */\r
+       private World world;\r
+\r
+       /**\r
+        * AtomInfoのデータをupdateします\r
+        * @param par1World Worldのインスタンス\r
+        * @param par2EntityPlayer EntityPlayerのインスタンス\r
+        */\r
+       public void update(World par1World, EntityPlayer par2EntityPlayer){\r
+               this.world = par1World;\r
+               this.entityPlayer = par2EntityPlayer;\r
+\r
+               this.posX = (int) par2EntityPlayer.posX;\r
+               this.posY = (int) par2EntityPlayer.posY;\r
+               this.posZ = (int) par2EntityPlayer.posZ;\r
 \r
                this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;\r
 \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){ // \89J\8a\8e\82Â\97\8b\r
-                       this.weather = "THUNDER";\r
-               }else if(rainy){ // \89J\82Ü\82½\82Í\90á\r
-                       this.weather = "RAINY";\r
-               }else{ //\90°\82ê\r
-                       this.weather = "SUNNY";\r
+               if (par1World.isThundering()){\r
+                       this.weather = "Thunder";\r
+               }else if(par1World.isRaining()){\r
+                       this.weather = "Rain";\r
+               }else{\r
+                       this.weather = "Sun";\r
                }\r
        }\r
 \r
+\r
+\r
        /**\r
-        * Y\8dÀ\95W\82Æ\82Ì\94ä\8ar\r
-        * @param EntityPlayer EntityPlayer\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
+        * 引数に指定されたBiomeと同等か比較します\r
+        * @param biomeName 比較するBiomeの名前\r
+        * @return Biomeが一致しているか\r
         */\r
-       private boolean equivalentBiome(String biomeName){\r
-               boolean ver1 = biomeName != null ? ((this.biomeName == biomeName) ? true : false) : true;\r
-               return ver1;\r
-       }\r
-       private boolean equivalentWeather(String weather){\r
-               boolean ver1 = weather != null ? ((this.weather == weather) ? true : false) : true;\r
-               return ver1;\r
-       }\r
-\r
-       protected void overY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){\r
-               if(this.posY >= y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){\r
-                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))\r
-                       {\r
-                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));\r
+       public boolean isEquivalentBiome(String biomeName){\r
+               if(this.biomeName != null){\r
+                       if(this.biomeName == biomeName){\r
+                               return true;\r
+                       }else{\r
+                               return false;\r
                        }\r
+               }else{\r
+                       System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");\r
+                       return false;\r
                }\r
        }\r
-       protected void aboveY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){\r
-               if(this.posY > y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){\r
-                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))\r
-                       {\r
-                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));\r
+\r
+\r
+\r
+       /**\r
+        * 引数に指定された天候と同等か比較します\r
+        * 晴れ:Sun, 雨:Rain, 雷雨:Thunder\r
+        * @param weather 比較する天候\r
+        * @return 天候が一致しているか\r
+        */\r
+       public boolean isEquivalentWeather(String weather){\r
+               if(this.weather != null){\r
+                       if(this.weather == weather){\r
+                               return true;\r
+                       }else{\r
+                               return false;\r
                        }\r
+               }else{\r
+                       System.err.println("AtonInfo:データが入っていません。updateメソッドでデータを入れてください");\r
+                       return false;\r
                }\r
        }\r
-       protected void equivalentY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){\r
-               if(this.posY == y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){\r
-                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))\r
-                       {\r
-                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));\r
-                       }\r
+\r
+\r
+\r
+       /**\r
+        * 引数に指定されたY軸より高いか判定します\r
+        * @param par1\r
+        * @return 指定されたY軸より高いか\r
+        */\r
+       public boolean isOverY(int par1){\r
+               if(this.posY >= par1){\r
+                       return true;\r
+               }else{\r
+                       return false;\r
                }\r
        }\r
-       protected void lessY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){\r
-               if(this.posY < y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){\r
-                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))\r
-                       {\r
-                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));\r
-                       }\r
+\r
+\r
+\r
+       /**\r
+        * 引数に指定されたY軸と同等か判定します\r
+        * @param par1\r
+        * @return 指定されたY軸と同等かどうか\r
+        */\r
+       public boolean isEquivalentY(int par1){\r
+               if(this.posY >= par1){\r
+                       return true;\r
+               }else{\r
+                       return false;\r
                }\r
        }\r
-       protected void belowY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){\r
-               if(this.posY <= y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){\r
-                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))\r
-                       {\r
-                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));\r
-                       }\r
+\r
+\r
+\r
+       /**\r
+        * 引数に指定されたY軸より低いか判定します\r
+        * @param par1\r
+        * @return 指定されたY軸より低いか\r
+        */\r
+       public boolean isBelowY(int par1){\r
+               if(this.posY >= par1){\r
+                       return true;\r
+               }else{\r
+                       return false;\r
                }\r
        }\r
 \r
index 946bb34..a68d2e5 100644 (file)
@@ -7,13 +7,10 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
 \r
 public class Auxiliary {\r
 \r
-       public Auxiliary(){\r
-       }\r
-\r
-       class NameAuxiliary{\r
+       class NameAuxiliary {\r
 \r
                /**\r
-                * \96¼\91O\82ð\92Ç\89Á\82·\82é\81B\r
+                * 名前を設定します\r
                 * @param object\r
                 * @param Name\r
                 */\r
@@ -21,8 +18,10 @@ public class Auxiliary {
                        LanguageRegistry.addName(object, (String) name);\r
                }\r
 \r
+\r
+\r
                /**\r
-                * \96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)\r
+                * 名前を設定します(ItemStack版)\r
                 * @param object\r
                 * @param name\r
                 * @param meta\r
@@ -32,27 +31,33 @@ public class Auxiliary {
                }\r
 \r
 \r
+\r
                /**\r
-                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é\81B\r
+                * 指定言語にそって名前を追加します\r
                 * @param object\r
+                * @param lang\r
                 * @param name\r
                 */\r
                public void addName(Object object,String lang,Object name){\r
                        LanguageRegistry.instance().addNameForObject(object, lang, (String) name);\r
                }\r
 \r
+\r
+\r
                /**\r
-                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)\r
+                * 指定言語にそって名前を追加します(ItemStack版)\r
                 * @param object\r
+                * @param lang\r
                 * @param name\r
                 */\r
-\r
                public void addName(ItemStack object,String lang,Object name){\r
                        LanguageRegistry.instance().addNameForObject(object, lang, (String) name);\r
                }\r
 \r
+\r
+\r
                /**\r
-                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Block\94Å)\r
+                * メタデータごとに名前を追加します(Block版)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -62,8 +67,10 @@ public class Auxiliary {
                        }\r
                }\r
 \r
+\r
+\r
                /**\r
-                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Item\94Å)\r
+                * メタデータごとに名前を追加します(Item版)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -73,8 +80,10 @@ public class Auxiliary {
                        }\r
                }\r
 \r
+\r
+\r
                /**\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
+                * 指定された言語にそってメタデータごとに名前を設定します(Block版)\r
                 * @param object\r
                 * @param name\r
                 */\r
@@ -84,8 +93,10 @@ public class Auxiliary {
                        }\r
                }\r
 \r
+\r
+\r
                /**\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
+                * 指定された言語にそってメタデータごとに名前を設定します(Item版)\r
                 * @param object\r
                 * @param name\r
                 */\r
index d5d1de7..b03ac5c 100644 (file)
@@ -10,20 +10,23 @@ import net.minecraft.src.World;
 
 public class BlockScienceCraftingTable extends BlockContainer {
 
-       public BlockScienceCraftingTable(int par1, int par2, Material par3Material) {
+       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)
-    {
+       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;
-    }
+               return true;
+       }
+
+
 
        @Override
-       public TileEntity createNewTileEntity(World var1) {
+       public TileEntity createNewTileEntity(World var1){
                return new TileEntityScienceCraftingTable();
        }
 
index 79f6ea0..c9dfa53 100644 (file)
@@ -1,4 +1,4 @@
-package chemicraft;\r
+package chemicraft;\r
 \r
 import net.minecraft.src.Block;\r
 import net.minecraft.src.CreativeTabs;\r
@@ -19,28 +19,33 @@ import cpw.mods.fml.common.registry.GameRegistry;
 // ID,名前,バージョン\r
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "[1.3.2]", channels = "chemicraft", packetHandler = PacketHandler.class)\r
 // クライアント、サーバー共に必要 1.3.2用\r
-public class ChemiCraft\r
-{\r
-\r
-       public static final String[] atomsName = { "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon",\r
-                       "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium",\r
-                       "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine",\r
-                       "Krypton", "Rubidium", "Strontium", "Yttorium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver",\r
-                       "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium",\r
-                       "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium",\r
-                       "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine",\r
-                       "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium",\r
-                       "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium",\r
-                       "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Ununtrium", "Ununquadium", "Ununpentium", "Ununhexium", "", "Ununoctium" };\r
-\r
-       public static final String[] atomsNameJP = { "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン",\r
-                       "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム", "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素",\r
-                       "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム", "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル",\r
-                       "ヨウ素", "キセノン", "セシウム", "バリウム", "ランタン", "セリウム", "プラセオジム", "ネオジム", "プロメチウム", "サマリウム", "ユウロビウム", "ガドリニウム", "テルビウム", "ジスプロニウム", "ホルミウム", "エルビウム",\r
-                       "ツリウム", "イッテルビウム", "ルテチウム", "ハフニウム", "タンタル", "タングステン", "レニウム", "オスミウム", "イリジウム", "白金", "金", "水銀", "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン",\r
-                       "フランシウム", "ラジウム", "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム",\r
-                       "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム", "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", "レントゲニウム", "コペルニシウム", "ウンウントリウム",\r
-                       "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "ウンウンセプチウム", "ウンウンオクチウム" };\r
+public class ChemiCraft {\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", "Scandium", "Titanium",\r
+               "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine",\r
+               "Krypton", "Rubidium", "Strontium", "Yttorium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver",\r
+               "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium",\r
+               "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium",\r
+               "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine",\r
+               "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium",\r
+               "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium",\r
+               "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Ununtrium", "Ununquadium", "Ununpentium", "Ununhexium", "Ununseptium", "Ununoctium"\r
+       };\r
+\r
+\r
+       public static final String[] atomsNameJP = {\r
+               "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン",\r
+               "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム", "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素",\r
+               "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム", "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル",\r
+               "ヨウ素", "キセノン", "セシウム", "バリウム", "ランタン", "セリウム", "プラセオジム", "ネオジム", "プロメチウム", "サマリウム", "ユウロビウム", "ガドリニウム", "テルビウム", "ジスプロニウム", "ホルミウム", "エルビウム",\r
+               "ツリウム", "イッテルビウム", "ルテチウム", "ハフニウム", "タンタル", "タングステン", "レニウム", "オスミウム", "イリジウム", "白金", "金", "水銀", "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン",\r
+               "フランシウム", "ラジウム", "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム",\r
+               "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム", "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", "レントゲニウム", "コペルニシウム", "ウンウントリウム",\r
+               "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "ウンウンセプチウム", "ウンウンオクチウム"\r
+       };\r
+\r
 \r
        /**\r
         * このmodのインスタンス\r
@@ -48,17 +53,20 @@ public class ChemiCraft
        @Mod.Instance("chemiCraft")\r
        public static ChemiCraft instance;\r
 \r
+\r
        /**\r
         * ChemiCraftのProxy\r
         */\r
        @SidedProxy(clientSide = "chemicraft.client.ClientProxy", serverSide = "chemicraft.CommonProxy")\r
        public static CommonProxy proxy;\r
 \r
+\r
        /**\r
         * ChemiCraftのCreativeTab\r
         */\r
        public static CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");\r
 \r
+\r
        /**\r
         * ItemID\r
         */\r
@@ -66,21 +74,25 @@ public class ChemiCraft
        public static int compoundsID;\r
        public static int gasCollectingBottleID;\r
 \r
+\r
        /**\r
         * BlockID\r
         */\r
        public static int scienceCraftingTableID;\r
 \r
+\r
        /**\r
         * GUIID\r
         */\r
        public static int guiScienceCraftingTableID;\r
 \r
+\r
        /**\r
         * Block型変数\r
         */\r
        public static Block blockScienceCraftingTable;\r
 \r
+\r
        /**\r
         * Item型変数\r
         */\r
@@ -88,15 +100,17 @@ public class ChemiCraft
        public static Item itemCompounds;\r
        public static Item itemGasCollectingBottle;\r
 \r
+\r
        /**\r
         * このmodに必要な補助クラスのインスタンス\r
         */\r
        private static Auxiliary Auxiliary = new Auxiliary();\r
        private static NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
 \r
+\r
+\r
        @Mod.PreInit\r
-       public void chemiPreLoadMethod(FMLPreInitializationEvent event)\r
-       {\r
+       public void chemiPreLoadMethod(FMLPreInitializationEvent event){\r
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
                cfg.load();\r
 \r
@@ -115,16 +129,17 @@ public class ChemiCraft
                cfg.save();\r
        }\r
 \r
+\r
+\r
        @Mod.PostInit\r
-       public void chemiPostLoadMethod(FMLPostInitializationEvent event)\r
-       {\r
+       public void chemiPostLoadMethod(FMLPostInitializationEvent event){\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)\r
-                               .setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ScienceCraftingTable");\r
+               .setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ScienceCraftingTable");\r
 \r
                // Itemを追加します\r
                itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
index 5f1a892..8e215d6 100644 (file)
@@ -9,31 +9,37 @@ public class ChemiCraftAPI {
         */
        public static ChemiCraftAPI instance = new ChemiCraftAPI();
 
+
        /**
         * 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.
@@ -44,6 +50,8 @@ public class ChemiCraftAPI {
                compoundsLangList.add("");
        }
 
+
+
        /**
         * add compound corresponding to the language.
         * @param lang Language to the corresponding
@@ -56,6 +64,8 @@ public class ChemiCraftAPI {
                compoundsLangList.add(lang);
        }
 
+
+
        /**
         * setting compound handler.
         * @param handlerItemName
@@ -66,7 +76,9 @@ public class ChemiCraftAPI {
                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();
@@ -74,21 +86,29 @@ public class ChemiCraftAPI {
 
        }
 
+
+
        public static ArrayList<String> getCompoundHandlerItemName(){
                compoundHandlerItemNames.trimToSize();
                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/ChemiCraftTab.java b/common/chemicraft/ChemiCraftTab.java
new file mode 100644 (file)
index 0000000..1caba5f
--- /dev/null
@@ -0,0 +1,92 @@
+package chemicraft;\r
+\r
+public class ChemiCraftTab {\r
+\r
+       /**\r
+        * TabのID\r
+        */\r
+       private int id;\r
+\r
+\r
+       /**\r
+        * TabにOverlayするTextureID\r
+        */\r
+       private int texture;\r
+\r
+\r
+       /**\r
+        * Tabの名前\r
+        */\r
+       private String tabName;\r
+\r
+\r
+       /**\r
+        * TabがActiveであるかどうか\r
+        */\r
+       private boolean theActive;\r
+\r
+\r
+\r
+       /**\r
+        * ChemiCraftTabを作成します\r
+        * @param id TabのID\r
+        * @param texture TabにOverlayする画像のTextureID\r
+        * @param tabName Tabの名前(最初は大文字にすること)\r
+        */\r
+       public ChemiCraftTab(int id, int texture, String tabName){\r
+               this.id = id;\r
+               this.texture = texture;\r
+               this.tabName = tabName;\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * TabのIDを返します\r
+        * @return TabのID\r
+        */\r
+       public int getID(){\r
+               return this.id;\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * TabにOverlayするTextureIDを返します\r
+        * @return TabにOverlayするTextureID\r
+        */\r
+       public int getTexture(){\r
+               return this.texture;\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Tabの名前を返します\r
+        * @return Tabの名前\r
+        */\r
+       public String getTabName(){\r
+               return this.tabName;\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Tabがアクティブであるかを返します\r
+        * @return Tabがアクティブであるか\r
+        */\r
+       public boolean isActive(){\r
+               return theActive;\r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Activeであるかを設定します\r
+        * @param active\r
+        */\r
+       public void setActive(boolean active){\r
+               this.theActive = active;\r
+       }\r
+\r
+}\r
diff --git a/common/chemicraft/ChemiCraftTabs.java b/common/chemicraft/ChemiCraftTabs.java
deleted file mode 100644 (file)
index f3a9992..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-package chemicraft;
-
-public class ChemiCraftTabs {
-
-       /**
-        * tabのID
-        */
-       private int id;
-
-       /**
-        * tabにOverlayするTextureID
-        */
-       private int texture;
-
-
-
-       /**
-        * tabの名前
-        */
-       private String tabName;
-
-       public ChemiCraftTabs(int id, int texture, String tabName){
-               this.id = id;
-               this.texture = texture;
-               this.tabName = tabName;
-       }
-
-
-
-       /**
-        * tabのIDを返します
-        * @return tabのID
-        */
-       public int getID(){
-               return this.id;
-       }
-
-
-
-       /**
-        * tabにOverlayするTextureIDを返します
-        * @return tabにOverlayするTextureID
-        */
-       public int getTexture(){
-               return this.texture;
-       }
-
-
-
-       /**
-        * tabの名前を返します
-        * @return tabの名前
-        */
-       public String getTabName(){
-               return this.tabName;
-       }
-
-}
index f19bfef..0d392e8 100644 (file)
@@ -5,17 +5,14 @@ import net.minecraft.src.TileEntity;
 import net.minecraft.src.World;
 import cpw.mods.fml.common.network.IGuiHandler;
 
-public class CommonProxy implements IGuiHandler
-{
+public class CommonProxy implements IGuiHandler {
+
+       public void registerRenderInformation(){}
 
-       public void registerRenderInformation()
-       {
 
-       }
 
        @Override
-       public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
-       {
+       public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
                if(!world.blockExists(x, y, z)) return null;
 
                TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
@@ -24,17 +21,19 @@ public class CommonProxy implements IGuiHandler
                        return new ContainerScienceCraftingTable(player.inventory, (TileEntityScienceCraftingTable)tileEntity);
                }
                return null;
-
        }
 
+
+
        @Override
-       public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
-       {
+       public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
                return null;
        }
 
-       public World getClientWorld()
-       {
+
+
+       public World getClientWorld(){
                return null;
        }
+
 }
\ No newline at end of file
index e13d149..105e1cf 100644 (file)
@@ -9,9 +9,9 @@ public class CompoundHandlerTest implements ICompoundHandler {
 
        @Override
        public void onRightClickHandler(ItemStack par1ItemStack, World par2World,
-                       EntityPlayer par3EntityPlayer) {
+                       EntityPlayer par3EntityPlayer) {}
+
 
-       }
 
        @Override
        public ItemStack onItemUseHandler(ItemStack par1ItemStack,
@@ -20,9 +20,10 @@ public class CompoundHandlerTest implements ICompoundHandler {
                return null;
        }
 
+
+
        @Override
        public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
-                       Entity par3Entity, int par4, boolean par5) {
-       }
+                       Entity par3Entity, int par4, boolean par5) {}
 
 }
index 5314e34..9a3d2c7 100644 (file)
@@ -8,47 +8,55 @@ import net.minecraft.src.ItemStack;
 import net.minecraft.src.Slot;
 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, TileEntityScienceCraftingTable par2)
-    {
-        this.worldObj = par2.worldObj;
-        this.posX = par2.xCoord;
-        this.posY = par2.yCoord;
-        this.posZ = par2.zCoord;
-        this.addSlotToContainer(new Slot(par2, 0, 10, 10));
-    }
-
-    /**
-     * 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;
-    }
+public class ContainerScienceCraftingTable extends Container {
+
+       /**
+        * Worldのインスタンス
+        */
+       private World worldObj;
+
+
+       /**
+        * BlockのX, Y, Z座標
+        */
+       private int posX;
+       private int posY;
+       private int posZ;
+
+
+
+       public ContainerScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2)
+       {
+               this.worldObj = par2.worldObj;
+               this.posX = par2.xCoord;
+               this.posY = par2.yCoord;
+               this.posZ = par2.zCoord;
+       }
+
+
+
+       @Override
+       public void onCraftMatrixChanged(IInventory par1IInventory){}
+
+
+
+       @Override
+       public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
+               super.onCraftGuiClosed(par1EntityPlayer);
+       }
+
+
+
+       @Override
+       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;
+       }
+
+
+
+       @Override
+       public ItemStack transferStackInSlot(int par1){
+               return null;
+       }
+
 }
index 21a9948..dbc28e4 100644 (file)
@@ -4,24 +4,24 @@ import net.minecraft.src.*;
 import cpw.mods.fml.common.Side;
 import cpw.mods.fml.common.asm.SideOnly;
 
-public class CreativeTabAtoms extends CreativeTabs{
+public class CreativeTabAtoms extends CreativeTabs {
 
-
-       public CreativeTabAtoms(String type) {
+       public CreativeTabAtoms(String type){
                super(type);
        }
 
+
        @Override
        @SideOnly(Side.CLIENT)
-       public int getTabIconItemIndex()
-       {
+       public int getTabIconItemIndex(){
                return ChemiCraft.itemGasCollectingBottle.shiftedIndex;
        }
 
+
+
        @Override
        @SideOnly(Side.CLIENT)
-       public String getTranslatedTabLabel()
-       {
+       public String getTranslatedTabLabel(){
                return "Atoms";
        }
 
index ad714f8..b85bac6 100644 (file)
 package chemicraft;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import net.minecraft.src.GuiContainer;
+import net.minecraft.src.InventoryBasic;
 import net.minecraft.src.InventoryPlayer;
-import net.minecraft.src.Slot;
-
-import org.lwjgl.opengl.GL11;
-
+import net.minecraft.src.Item;
 import cpw.mods.fml.common.Side;
 import cpw.mods.fml.common.asm.SideOnly;
 
 @SideOnly(Side.CLIENT)
-public class GuiScienceCraftingTable extends GuiContainer
-{
+public class GuiScienceCraftingTable extends GuiContainer {
+
+       /**
+        * ActiveなTabの名前
+        */
+       private static String activeTabName;
+
+
+       /**
+        * 分解機GUIのInventoryBasicクラス
+        */
+       private static InventoryBasic decompositionSlots = new InventoryBasic("Decomposition", 17);
+
+
+       /**
+        * TabListのArrayList
+        */
+       private ArrayList<ChemiCraftTab> tabList = new ArrayList<ChemiCraftTab>();
+
+
+       /**
+        * Gui画像のHashMap
+        * キーの名前は拡張子を除くファイル名にする
+        */
+       private HashMap<String, Integer> guiImageMap = new HashMap<String, Integer>();
 
-       private ArrayList<ChemiCraftTabs> tabList = new ArrayList<ChemiCraftTabs>();
 
-       public GuiScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2)
-       {
+       /**
+        * 画像のHashMap
+        * キーの名前は拡張子を除くファイル名にする
+        */
+       private HashMap<String, Integer> otherImageMap = new HashMap<String, Integer>();
+
+
+
+       public GuiScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2){
                super(new ContainerScienceCraftingTable(par1InventoryPlayer, par2));
+               //TabListにTabを追加する
+               tabList.add(new ChemiCraftTab(0, Item.potion.getIconFromDamage(0), "Decomposition"));
+               //ActiveTabの初期化
+               /*未実装*/
+               /*Debug*/ this.tabList.get(0).setActive(true); for(int i = 0;i < tabList.size();i++){ if(this.tabList.get(i).isActive()){ this.activeTabName = this.tabList.get(i).getTabName(); } }
        }
 
+
+
        @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);
+       protected void mouseClicked(int par1, int par2, int par3){
+               super.mouseClicked(par1, par2, par3);
        }
 
+
+
        @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);
+       protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3){
+               //Texture Load.
+               this.func_00002();
+               //Draw Tabs.
+               this.func_00001(par1, par2, par3);
+               //Draw GUI
+               if(this.activeTabName.equals("Decomposition")){
+                       this.mc.renderEngine.bindTexture(this.guiImageMap.get("Decomposition"));
+                       this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
                }
        }
 
-       @Override
-       protected void handleMouseClick(Slot par1Slot, int par2, int par3, boolean par4){
-               System.out.println(par2);
-               System.out.println(par3);
+
+
+       private void func_00001(float par1, int par2, int par3){
+               int var1 = this.guiLeft;
+               int var2 = this.guiTop - 32;
+               for(int i = 0;i < this.tabList.size();i++){
+                       if(!this.tabList.get(i).isActive()){
+                               this.mc.renderEngine.bindTexture(this.otherImageMap.get("tabs"));
+                               this.drawTexturedModalRect(var1 + (28 * i), var2, 0, 0, 28, 32);
+                               this.mc.renderEngine.bindTexture(this.tabList.get(i).getTexture());
+                               this.drawTexturedModalRect(var1 + (28 * i) + 14, var2 + 16, 0, 0, 16, 16);
+                       }else{
+                               this.mc.renderEngine.bindTexture(this.otherImageMap.get("tabs"));
+                               this.drawTexturedModalRect(var1 + (28 * i), var2, 0, 32, 28, 32);
+                       }
+               }
        }
 
-       @Override
-       protected void mouseClicked(int par1, int par2, int par3)
-       {
-               super.mouseClicked(par1, par2, par3);
+
+
+       private void func_00002(){
+               //guiImageMapに画像を格納する
+               guiImageMap.put("Decomposition", this.mc.renderEngine.getTexture("/ChemiCraft/guis/Decomposition.png"));
+               //otherImageMapに画像を格納する
+               otherImageMap.put("tabs", this.mc.renderEngine.getTexture("/ChemiCraft/guis/tabs.png"));
+       }
+
+
+
+       /**
+        * Activeなtabの名前を返します
+        * @return ActiveなTabの名前
+        */
+       public static String getActiveTabName(){
+               return activeTabName;
        }
 
-       private void addTabs(int id, int Texture, String name){
-               for(int i = 0;i < tabList.size();i++){
-                       if(id == tabList.get(i).getID()){
+
+
+       /**
+        * ActiveなTabに対応したInventoryBasicクラスを返します
+        * @return ActiveなTabに対応したInventoryBasicクラス
+        */
+       public static InventoryBasic getActiveInventory(){
+               return decompositionSlots;
+       }
+
+
+
+       /**
+        * ChemiCraftTabを追加します。
+        * @param id TabのID
+        * @param texture OverlayするTextureID
+        * @param name Tabの名前
+        * @throws Exception IDが重複している場合にスローされます
+        */
+       private void addTabs(int id, int texture, String name){
+               for(int i = 0;i < this.tabList.size();i++){
+                       if(id == this.tabList.get(i).getID()){
                                try {
                                        throw new Exception("ChemiCraft内でエラー:ChemiCraftTabのIDが重複しています");
                                } catch (Exception e) {
@@ -70,7 +143,7 @@ public class GuiScienceCraftingTable extends GuiContainer
                                }
                        }
                }
-               tabList.add(new ChemiCraftTabs(id, Texture, name));
+               this.tabList.add(new ChemiCraftTab(id, texture, name));
        }
 
 }
index 3e69c18..85aad95 100644 (file)
@@ -7,10 +7,40 @@ import net.minecraft.src.World;
 
 public interface ICompoundHandler {
 
-       void onRightClickHandler(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
+       /**
+        * 右クリック時のHandler
+        * @param par1ItemStack
+        * @param par2World
+        * @param par3EntityPlayer
+        */
+       public void onRightClickHandler(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
 
-       ItemStack onItemUseHandler(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10);
 
-       void onUpdateHandler(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5);
+       /**
+        * Itemを使用したときのHandler
+        * @param par1ItemStack
+        * @param par2EntityPlayer
+        * @param par3World
+        * @param par4
+        * @param par5
+        * @param par6
+        * @param par7
+        * @param par8
+        * @param par9
+        * @param par10
+        * @return
+        */
+       public ItemStack onItemUseHandler(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10);
+
+
+       /**
+        * 毎Tick呼ばれるHandler
+        * @param par1ItemStack
+        * @param par2World
+        * @param par3Entity
+        * @param par4
+        * @param par5
+        */
+       public void onUpdateHandler(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5);
 
 }
diff --git a/common/chemicraft/ItemAtomInfoContainer.java b/common/chemicraft/ItemAtomInfoContainer.java
new file mode 100644 (file)
index 0000000..7373809
--- /dev/null
@@ -0,0 +1,18 @@
+package chemicraft;\r
+\r
+import net.minecraft.src.Item;\r
+\r
+public class ItemAtomInfoContainer extends Item {\r
+\r
+       /**\r
+        * AtonInfoのインスタンス\r
+        */\r
+       public AtomInfo atomInfo = new AtomInfo();\r
+\r
+\r
+\r
+       public ItemAtomInfoContainer(int par1){\r
+               super(par1);\r
+       }\r
+\r
+}\r
index 12d9469..4b94bbb 100644 (file)
@@ -12,43 +12,46 @@ import cpw.mods.fml.common.asm.SideOnly;
 
 public class ItemAtoms extends Item {
 
-    public ItemAtoms(int par1) {
-        super(par1);
-        this.maxStackSize = 1;
-        this.setHasSubtypes(true);
-        this.setMaxDamage(0);
-        this.setCreativeTab(ChemiCraft.instance.creativeTab);
-    }
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
-    {
-        for(int type = 0; type < ChemiCraft.atomsName.length; type++)
-        {
-              par3List.add(new ItemStack(par1, 1, type));
-              this.setIconIndex(type);
-        }
-    }
-
-    @Override
-    public String getItemNameIS(ItemStack par1ItemStack)
-    {
-        return super.getItemName() + "." + ChemiCraft.atomsName[par1ItemStack.getItemDamage()];
-    }
-
-    @Override
-    public String getTextureFile()
-    {
-        this.isDefaultTexture = false;
-        return "/ChemiCraft/items/Atoms.png";
-    }
-
-    @SideOnly(Side.CLIENT)
-    @Override
-    public int getIconFromDamage(int par1)
-    {
-        return par1;
-    }
+       public ItemAtoms(int par1){
+               super(par1);
+               this.maxStackSize = 1;
+               this.setHasSubtypes(true);
+               this.setMaxDamage(0);
+               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+       }
+
+
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
+               for(int type = 0; type < ChemiCraft.atomsName.length; type++)
+               {
+                       par3List.add(new ItemStack(par1, 1, type));
+                       this.setIconIndex(type);
+               }
+       }
+
+
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack){
+               return super.getItemName() + "." + ChemiCraft.atomsName[par1ItemStack.getItemDamage()];
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return "/ChemiCraft/items/Atoms.png";
+       }
+
+
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       public int getIconFromDamage(int par1){
+               return par1;
+       }
 
 }
\ No newline at end of file
index dfdeb0e..6aa52fc 100644 (file)
@@ -12,7 +12,7 @@ import net.minecraft.src.World;
 
 public class ItemCompounds extends Item {
 
-       public ItemCompounds(int par1) {
+       public ItemCompounds(int par1){
                super(par1);
                this.maxStackSize = 1;
                this.setHasSubtypes(true);
@@ -20,6 +20,8 @@ public class ItemCompounds extends Item {
                this.setCreativeTab(ChemiCraft.instance.creativeTab);
        }
 
+
+
        @Override
        public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
                for(int i=0;i < ChemiCraftAPI.getCompoundsName().size();i++){
@@ -31,10 +33,11 @@ public class ItemCompounds extends Item {
                }
        }
 
+
+
        @SideOnly(Side.CLIENT)
        @Override
-       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
-       {
+       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
                for(int type = 0; type < ChemiCraftAPI.getCompoundsName().toArray().length; type++)
                {
                        par3List.add(new ItemStack(par1, 1, type));
@@ -42,23 +45,25 @@ public class ItemCompounds extends Item {
                }
        }
 
+
+
        @Override
-       public String getItemNameIS(ItemStack par1ItemStack)
-       {
+       public String getItemNameIS(ItemStack par1ItemStack){
                return super.getItemName() + "." + ChemiCraftAPI.getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
        }
 
+
+
        @Override
-       public String getTextureFile()
-       {
-               this.isDefaultTexture = false;
+       public String getTextureFile(){
                return "/ChemiCraft/items/Compounds.png";
        }
 
+
+
        @SideOnly(Side.CLIENT)
        @Override
-       public int getIconFromDamage(int par1)
-       {
+       public int getIconFromDamage(int par1){
                return par1;
        }
 
index 26f3201..17843c8 100644 (file)
@@ -4,7 +4,7 @@ import java.util.Random;
 
 import net.minecraft.src.*;
 
-public class ItemGasCollectingBottle extends Item {
+public class ItemGasCollectingBottle extends ItemAtomInfoContainer {
 
        public ItemGasCollectingBottle(int id) {
                super(id);
@@ -15,18 +15,21 @@ public class ItemGasCollectingBottle extends Item {
 
        @Override
        public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
-
                par1ItemStack.damageItem(1, par3EntityPlayer);
-               AtomInfo AtomInfo = new AtomInfo(par2World, par3EntityPlayer);
-               AtomInfo.aboveY(par3EntityPlayer, 128, null, null, 0, 7);
+
+               this.atomInfo.update(par2World, par3EntityPlayer);
+               if(this.atomInfo.isBelowY(129)){
+                       if(!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.instance.atomsID, 1, 7))){
+                               par3EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.instance.atomsID, 1, 7));
+                       }
+               }
+
                return par1ItemStack;
        }
 
        @Override
-    public String getTextureFile()
-    {
-        this.isDefaultTexture = false;
-        return "/ChemiCraft/items/sprite.png";
-    }
+       public String getTextureFile() {
+               return "/ChemiCraft/items/sprite.png";
+       }
 
 }
index 13c01a2..52e1535 100644 (file)
@@ -10,13 +10,9 @@ import cpw.mods.fml.common.network.Player;
  * @author Lilly\r
  *\r
  */\r
-public class PacketHandler implements IPacketHandler\r
-{\r
+public class PacketHandler implements IPacketHandler {\r
 \r
        @Override\r
-       public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player)\r
-       {\r
-\r
-       }\r
+       public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player){}\r
 \r
 }\r
index 6f5bb03..8653f7f 100644 (file)
@@ -7,73 +7,95 @@ import net.minecraft.src.NBTTagCompound;
 import net.minecraft.src.Packet;
 import net.minecraft.src.TileEntity;
 
-public class TileEntityScienceCraftingTable extends TileEntity implements IInventory{
+public class TileEntityScienceCraftingTable extends TileEntity implements IInventory {
+
+       /**
+        * InventorySlotのItemStack配列
+        */
+       private ItemStack[] inventory = new ItemStack[17];
+
+
+
+       public TileEntityScienceCraftingTable(){}
 
-       private ItemStack[] inventory = new ItemStack[10];
 
-       public TileEntityScienceCraftingTable(){
-       }
 
        @Override
        public void updateEntity(){
                super.updateEntity();
        }
 
+
+
        @Override
-       public void readFromNBT(NBTTagCompound par1){
-       }
+       public void readFromNBT(NBTTagCompound par1){}
+
+
 
        @Override
-       public void writeToNBT(NBTTagCompound par1){
-       }
+       public void writeToNBT(NBTTagCompound par1){}
+
+
 
        @Override
        public int getSizeInventory() {
                return inventory.length;
        }
 
+
+
        @Override
        public ItemStack getStackInSlot(int var1) {
                return inventory[var1];
        }
 
+
+
        @Override
        public ItemStack decrStackSize(int var1, int var2) {
                return null;
        }
 
+
+
        @Override
        public ItemStack getStackInSlotOnClosing(int var1) {
                return null;
        }
 
+
+
        @Override
-       public void setInventorySlotContents(int var1, ItemStack var2) {
+       public void setInventorySlotContents(int var1, ItemStack var2) {}
+
 
-       }
 
        @Override
        public String getInvName() {
                return null;
        }
 
+
+
        @Override
        public int getInventoryStackLimit() {
                return 64;
        }
 
+
+
        @Override
        public boolean isUseableByPlayer(EntityPlayer var1) {
                return false;
        }
 
-       @Override
-       public void openChest() {
 
-       }
 
        @Override
-       public void closeChest() {
+       public void openChest() {}
 
-       }
+
+
+       @Override
+       public void closeChest() {}
 }
index 93ad16e..4d748bd 100644 (file)
@@ -13,10 +13,9 @@ public class ClientProxy extends CommonProxy
 {
 
        @Override
-       public void registerRenderInformation()
-       {
+       public void registerRenderInformation(){}
+
 
-       }
 
        @Override
        public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
@@ -31,6 +30,8 @@ public class ClientProxy extends CommonProxy
                return null;
        }
 
+
+
        @Override
        public World getClientWorld()
        {