OSDN Git Service

なんかわけわかめ
authormozipi <mozipi@users.sourceforge.jp>
Fri, 23 Nov 2012 12:34:42 +0000 (21:34 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Fri, 23 Nov 2012 12:34:42 +0000 (21:34 +0900)
AtomInfo.java [new file with mode: 0644]
Auxiliary.java [new file with mode: 0644]
ChemiCraft.java [new file with mode: 0644]
ChemiCraftAPI.java [new file with mode: 0644]
CompoundHandlerTest.java [new file with mode: 0644]
ICompoundHandler.java [new file with mode: 0644]
ItemAtoms.java [new file with mode: 0644]
ItemCompounds.java [new file with mode: 0644]
ItemGasCollectingBottle.java [new file with mode: 0644]

diff --git a/AtomInfo.java b/AtomInfo.java
new file mode 100644 (file)
index 0000000..3254b85
--- /dev/null
@@ -0,0 +1,93 @@
+package net.minecraft.src.ChemiCraft;
+
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
+
+public class AtomInfo {
+
+       protected static int posX;
+       protected static int posY;
+       protected static int posZ;
+       protected static String biomeName;
+       protected static String weather;
+
+       public AtomInfo(World par1World, EntityPlayer par2EntityPlayer){
+
+               this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName;
+
+               this.posX = (int) par2EntityPlayer.posX; // X\8dÀ\95W
+               this.posY = (int) par2EntityPlayer.posY; // Y\8dÀ\95W
+               this.posZ = (int) par2EntityPlayer.posZ; // Z\8dÀ\95W
+
+               boolean rainy = par1World.isRaining();
+               boolean thunder = par1World.isThundering();
+               if (rainy && thunder){ // \89J\8a\8e\82Â\97\8b
+                       this.weather = "THUNDER";
+               }else if(rainy){ // \89J\82Ü\82½\82Í\90á
+                       this.weather = "RAINY";
+               }else{ //\90°\82ê
+                       this.weather = "SUNNY";
+               }
+       }
+
+       /**
+        * Y\8dÀ\95W\82Æ\82Ì\94ä\8ar
+        * @param EntityPlayer EntityPlayer
+        * @param y Y\8dÀ\95W
+        * @param biomeName \83o\83C\83I\81[\83\80\82Ì\96¼\91O(null\82Å\82à\89Â)
+        * @param weather \93V\8bC(null\82Å\82à\89Â)
+        * @param par1 \93ü\8eè\90\94
+        * @param par2 \8eí\97Þ(\83_\83\81\81[\83W\92l)
+        */
+       private boolean equivalentBiome(String biomeName){
+               boolean ver1 = biomeName != null ? ((this.biomeName == biomeName) ? true : false) : true;
+               return ver1;
+       }
+       private boolean equivalentWeather(String weather){
+               boolean ver1 = weather != null ? ((this.weather == weather) ? true : false) : true;
+               return ver1;
+       }
+
+       protected void overY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){
+               if(this.posY >= y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){
+                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))
+                       {
+                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));
+                       }
+               }
+       }
+       protected void aboveY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){
+               if(this.posY > y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){
+                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))
+                       {
+                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));
+                       }
+               }
+       }
+       protected void equivalentY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){
+               if(this.posY == y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){
+                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))
+                       {
+                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));
+                       }
+               }
+       }
+       protected void lessY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){
+               if(this.posY < y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){
+                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))
+                       {
+                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));
+                       }
+               }
+       }
+       protected void belowY(EntityPlayer EntityPlayer, int y, String biomeName, String weather, int par1, int par2){
+               if(this.posY <= y && this.equivalentBiome(biomeName) && this.equivalentWeather(weather)){
+                       if (!EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ChemiCraft.itemAtoms, par1, par2)))
+                       {
+                               EntityPlayer.dropPlayerItem(new ItemStack(ChemiCraft.itemAtoms.shiftedIndex, par1, par2));
+                       }
+               }
+       }
+
+}
diff --git a/Auxiliary.java b/Auxiliary.java
new file mode 100644 (file)
index 0000000..10469fe
--- /dev/null
@@ -0,0 +1,100 @@
+package net.minecraft.src.ChemiCraft;
+
+import net.minecraft.src.Block;
+import net.minecraft.src.Item;
+import net.minecraft.src.ItemStack;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+
+public class Auxiliary {
+
+       public Auxiliary(){
+       }
+
+       class NameAuxiliary{
+
+               /**
+                * \96¼\91O\82ð\92Ç\89Á\82·\82é\81B
+                * @param object
+                * @param Name
+                */
+               public void addName(Object object,Object name){
+                       LanguageRegistry.addName(object, (String) name);
+               }
+
+               /**
+                * \96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)
+                * @param object
+                * @param name
+                * @param meta
+                */
+               public void addName(ItemStack itemstack,Object name){
+                       LanguageRegistry.addName(itemstack, (String) name);
+               }
+               
+
+               /**
+                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é\81B
+                * @param object
+                * @param name
+                */
+               public void addName(Object object,String lang,Object name){
+                       LanguageRegistry.instance().addNameForObject(object, lang, (String) name);
+               }
+
+               /**
+                * \8ew\92è\82µ\82½\8c¾\8cê\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(ItemStack\94Å)
+                * @param object
+                * @param name
+                */
+
+               public void addName(ItemStack object,String lang,Object name){
+                       LanguageRegistry.instance().addNameForObject(object, lang, (String) name);
+               }
+
+               /**
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Block\94Å)
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);
+                       }
+               }
+
+               /**
+                * \83\81\83^\83f\81[\83^+\94z\97ñ\82Å\96¼\91O\82ð\92Ç\89Á\82·\82é(Item\94Å)
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.addName(new ItemStack(object,0,i), (String) name[i]);
+                       }
+               }
+
+               /**
+                * \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Å)
+                * @param object
+                * @param name
+                */
+               public void addName(Block object,String lang,Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);
+                       }
+               }
+
+               /**
+                * \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Å)
+                * @param object
+                * @param name
+                */
+               public void addName(Item object,String lang, Object[] name){
+                       for(int i=0;i<name.length;i++){
+                               LanguageRegistry.instance().addNameForObject(new ItemStack(object,0,i), lang, (String) name[i]);
+                       }
+               }
+
+       }
+
+}
diff --git a/ChemiCraft.java b/ChemiCraft.java
new file mode 100644 (file)
index 0000000..8f6fea6
--- /dev/null
@@ -0,0 +1,108 @@
+package net.minecraft.src.ChemiCraft;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import net.minecraft.src.Block;
+import net.minecraft.src.Item;
+import net.minecraft.src.ItemStack;
+import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.Property;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+
+@Mod( modid = "chemiCraft", name="ChemiCraft", version="\83e\83X\83g\94Å") //ID,\96¼\91O,\83o\81[\83W\83\87\83\93
+@NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "[1.3.2]") //\83N\83\89\83C\83A\83\93\83g\81A\83T\81[\83o\81[\8b¤\82É\95K\97v 1.3.2\97p
+
+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","","Ununoctium"
+       };
+
+       public static final String[] atomsNameJP = {
+               "\90\85\91f", "\83w\83\8a\83E\83\80", "\83\8a\83`\83E\83\80", "\83x\83\8a\83E\83\80", "\83z\83E\91f", "\92Y\91f", "\92\82\91f", "\8e_\91f", "\83t\83b\91f", "\83l\83I\83\93",
+               "\83i\83g\83\8a\83E\83\80", "\83}\83O\83l\83V\83E\83\80", "\83A\83\8b\83~\83j\83E\83\80", "\83P\83C\91f", "\83\8a\83\93", "\97°\89©", "\89\96\91f", "\83A\83\8b\83S\83\93", "\83J\83\8a\83E\83\80", "\83J\83\8b\83V\83E\83\80",
+               "\83X\83J\83\93\83W\83E\83\80", "\83`\83^\83\93", "\83o\83i\83W\83E\83\80", "\83N\83\8d\83\80", "\83}\83\93\83K\83\93", "\93S", "\83R\83o\83\8b\83g", "\83j\83b\83P\83\8b", "\93º", "\88\9f\89\94",
+               "\83K\83\8a\83E\83\80", "\83Q\83\8b\83}\83j\83E\83\80", "\83q\91f", "\83Z\83\8c\83\93", "\8fL\91f", "\83N\83\8a\83v\83g\83\93", "\83\8b\83r\83W\83E\83\80", "\83X\83g\83\8d\83\93\83`\83E\83\80", "\83C\83b\83g\83\8a\83E\83\80", "\83W\83\8b\83R\83j\83E\83\80",
+               "\83j\83I\83u", "\83\82\83\8a\83u\83f\83\93", "\83e\83N\83l\83`\83E\83\80", "\83\8b\83e\83j\83E\83\80", "\83\8d\83W\83E\83\80", "\83p\83\89\83W\83E\83\80", "\8bâ", "\83J\83h\83~\83E\83\80", "\83C\83\93\83W\83E\83\80", "\83X\83Y",
+               "\83A\83\93\83`\83\82\83\93", "\83e\83\8b\83\8b", "\83\88\83E\91f", "\83L\83Z\83m\83\93", "\83Z\83V\83E\83\80", "\83o\83\8a\83E\83\80", "\83\89\83\93\83^\83\93", "\83Z\83\8a\83E\83\80", "\83v\83\89\83Z\83I\83W\83\80", "\83l\83I\83W\83\80",
+               "\83v\83\8d\83\81\83`\83E\83\80", "\83T\83}\83\8a\83E\83\80", "\83\86\83E\83\8d\83r\83E\83\80", "\83K\83h\83\8a\83j\83E\83\80", "\83e\83\8b\83r\83E\83\80", "\83W\83X\83v\83\8d\83j\83E\83\80", "\83z\83\8b\83~\83E\83\80", "\83G\83\8b\83r\83E\83\80", "\83c\83\8a\83E\83\80", "\83C\83b\83e\83\8b\83r\83E\83\80",
+               "\83\8b\83e\83`\83E\83\80", "\83n\83t\83j\83E\83\80", "\83^\83\93\83^\83\8b", "\83^\83\93\83O\83X\83e\83\93", "\83\8c\83j\83E\83\80", "\83I\83X\83~\83E\83\80", "\83C\83\8a\83W\83E\83\80", "\94\92\8bà", "\8bà", "\90\85\8bâ",
+               "\83^\83\8a\83E\83\80", "\89\94", "\83r\83X\83}\83X", "\83|\83\8d\83j\83E\83\80", "\83A\83X\83^\83`\83\93", "\83\89\83h\83\93", "\83t\83\89\83\93\83V\83E\83\80", "\83\89\83W\83E\83\80", "\83A\83N\83`\83j\83E\83\80", "\83g\83\8a\83E\83\80",
+               "\83v\83\8d\83g\83A\83N\83`\83E\83\80", "\83E\83\89\83\93", "\83l\83v\83c\83j\83E\83\80", "\83v\83\8b\83g\83j\83E\83\80", "\83A\83\81\83\8a\83V\83E\83\80", "\83L\83\85\83\8a\83E\83\80", "\83o\81[\83N\83\8a\83E\83\80", "\83J\83\8b\83z\83\8b\83j\83E\83\80", "\83A\83C\83\93\83X\83^\83C\83j\83E\83\80", "\83t\83F\83\8b\83~\83E\83\80",
+               "\83\81\83\93\83f\83\8c\83r\83E\83\80", "\83m\81[\83x\83\8a\83E\83\80", "\83\8d\81[\83\8c\83\93\83V\83E\83\80", "\83\89\83T\83z\81[\83W\83E\83\80", "\83h\83u\83j\83E\83\80", "\83V\81[\83{\81[\83M\83E\83\80", "\83{\81[\83\8a\83E\83\80", "\83n\83b\83V\83E\83\80", "\83}\83C\83g\83l\83\8a\83E\83\80", "\83_\81[\83\80\83X\83^\83`\83E\83\80",
+               "\83\8c\83\93\83g\83Q\83j\83E\83\80", "\83R\83y\83\8b\83j\83V\83E\83\80", "\83E\83\93\83E\83\93\83g\83\8a\83E\83\80", "\83t\83\8c\83\8d\83r\83E\83\80", "\83E\83\93\83E\83\93\83y\83\93\83`\83E\83\80", "\83\8a\83o\83\82\83\8a\83E\83\80", "\83E\83\93\83E\83\93\83Z\83v\83`\83E\83\80", "\83E\83\93\83E\83\93\83I\83N\83`\83E\83\80"
+       };
+
+       private ChemiCraftAPI chemiCraftAPI = ChemiCraftAPI.instance;
+
+       public static int atomsID;
+       public static int compoundsID;
+       public static int gasCollectingBottleID;
+
+       public static Item itemAtoms;
+       public static Item itemCompounds;
+       public static Item itemGasCollectingBottle;
+
+       private Auxiliary Auxiliary = new Auxiliary();
+       private Auxiliary.NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();
+
+       // \83R\83\93\83X\83g\83\89\83N\83^
+       @Mod.Init
+       public void chemiLoadMethod(FMLInitializationEvent event)
+       {
+               //\89»\8d\87\95¨\82Ì\92Ç\89Á
+               ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "\89\96");
+       }
+
+       @Mod.PreInit  // \91O\8f\88\97\9d
+       public void chemiPreLoadMethod(FMLPreInitializationEvent event)
+       {
+               Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
+               cfg.load();
+               Property atomsIDProp = cfg.getItem("atomsID", 25000);
+               Property compoundsIDProp = cfg.getItem("compoundsID", 25001);
+               Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);
+               atomsID = atomsIDProp.getInt();
+               compoundsID = compoundsIDProp.getInt();
+               gasCollectingBottleID = gasCollectingBottleIDProp.getInt();
+               cfg.save();
+       }
+
+       @Mod.PostInit // ModLoader.load\83\81\83\\83b\83h\82Æ\93¯\93\99
+       public void chemiPostLoadMethod(FMLPostInitializationEvent event)
+       {
+               itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");
+               itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");
+               itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");
+
+               NameAuxiliary.addName(itemAtoms, atomsName);
+               NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP);
+               NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());
+               NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());
+               NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle");
+               NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "\8fW\8bC\95r");
+
+               ChemiCraftAPI.addCompoundHandler("Salt", new CompoundHandlerTest());
+
+       }
+
+}
\ No newline at end of file
diff --git a/ChemiCraftAPI.java b/ChemiCraftAPI.java
new file mode 100644 (file)
index 0000000..f624aa7
--- /dev/null
@@ -0,0 +1,59 @@
+package net.minecraft.src.ChemiCraft;
+
+import java.util.ArrayList;
+
+public class ChemiCraftAPI {
+
+       public static ChemiCraftAPI instance = new ChemiCraftAPI();
+
+       private boolean addLanguage = false;
+       private static ArrayList<String> compoundsNameList = new ArrayList();
+       private static ArrayList<String> compoundsLangNameList = new ArrayList();
+       private static ArrayList<String> compoundsLangList = new ArrayList();
+       private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
+       private static ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
+
+       public static void addCompound(String name){
+               compoundsNameList.add(name);
+               compoundsLangNameList.add("");
+               compoundsLangList.add("");
+       }
+
+       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){
+               ChemiCraftAPI.compoundHandlers.add(compoundHandler);
+               compoundHandlerItemNames.add(handlerItemName);
+       }
+
+       public static ArrayList<ICompoundHandler> getCompoundHandler(){
+               compoundHandlers.trimToSize();
+               return compoundHandlers;
+
+       }
+
+       public static ArrayList<String> getCompoundHandlerItemName(){
+               compoundHandlerItemNames.trimToSize();
+               return compoundHandlerItemNames;
+       }
+
+}
diff --git a/CompoundHandlerTest.java b/CompoundHandlerTest.java
new file mode 100644 (file)
index 0000000..ea9acc8
--- /dev/null
@@ -0,0 +1,28 @@
+package net.minecraft.src.ChemiCraft;
+
+import net.minecraft.src.Entity;
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
+
+public class CompoundHandlerTest implements ICompoundHandler {
+
+       @Override
+       public void onRightClickHandler(ItemStack par1ItemStack, World par2World,
+                       EntityPlayer par3EntityPlayer) {
+
+       }
+
+       @Override
+       public ItemStack onItemUseHandler(ItemStack par1ItemStack,
+                       EntityPlayer par2EntityPlayer, World par3World, int par4, int par5,
+                       int par6, int par7, float par8, float par9, float par10) {
+               return null;
+       }
+
+       @Override
+       public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
+                       Entity par3Entity, int par4, boolean par5) {
+       }
+
+}
diff --git a/ICompoundHandler.java b/ICompoundHandler.java
new file mode 100644 (file)
index 0000000..d099281
--- /dev/null
@@ -0,0 +1,16 @@
+package net.minecraft.src.ChemiCraft;
+
+import net.minecraft.src.Entity;
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
+
+public interface ICompoundHandler {
+
+       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);
+
+}
diff --git a/ItemAtoms.java b/ItemAtoms.java
new file mode 100644 (file)
index 0000000..c0afa7e
--- /dev/null
@@ -0,0 +1,54 @@
+package net.minecraft.src.ChemiCraft;
+
+import java.util.List;
+
+import net.minecraft.src.CreativeTabs;
+import net.minecraft.src.EntityPlayer;
+import net.minecraft.src.Item;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
+import cpw.mods.fml.common.Side;
+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(CreativeTabs.tabMaterials);
+    }
+
+    @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/Atoms.png";
+    }
+
+    @SideOnly(Side.CLIENT)
+    @Override
+    public int getIconFromDamage(int par1)
+    {
+        return par1;
+    }
+
+}
\ No newline at end of file
diff --git a/ItemCompounds.java b/ItemCompounds.java
new file mode 100644 (file)
index 0000000..36bad92
--- /dev/null
@@ -0,0 +1,65 @@
+package net.minecraft.src.ChemiCraft;
+
+import java.util.List;
+
+import cpw.mods.fml.common.Side;
+import cpw.mods.fml.common.asm.SideOnly;
+import net.minecraft.src.CreativeTabs;
+import net.minecraft.src.Entity;
+import net.minecraft.src.Item;
+import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
+
+public class ItemCompounds extends Item {
+
+       public ItemCompounds(int par1) {
+               super(par1);
+               this.maxStackSize = 1;
+               this.setHasSubtypes(true);
+               this.setMaxDamage(0);
+               this.setCreativeTab(CreativeTabs.tabMaterials);
+       }
+
+       @Override
+       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
+               for(int i=0;i < ChemiCraftAPI.getCompoundsName().size();i++){
+                       for(int j=0;j < ChemiCraftAPI.getCompoundHandlerItemName().size();j++){
+                               if(ChemiCraftAPI.getCompoundsName().get(i).equals(ChemiCraftAPI.getCompoundHandlerItemName().get(i))){
+                                       ChemiCraftAPI.getCompoundHandler().get(j).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
+                               }
+                       }
+               }
+       }
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       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));
+                       this.setIconIndex(type);
+               }
+       }
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack)
+       {
+               return super.getItemName() + "." + ChemiCraftAPI.getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
+       }
+
+       @Override
+       public String getTextureFile()
+       {
+               this.isDefaultTexture = false;
+               return "/ChemiCraft/Compounds.png";
+       }
+
+       @SideOnly(Side.CLIENT)
+       @Override
+       public int getIconFromDamage(int par1)
+       {
+               return par1;
+       }
+
+}
diff --git a/ItemGasCollectingBottle.java b/ItemGasCollectingBottle.java
new file mode 100644 (file)
index 0000000..9fd8d53
--- /dev/null
@@ -0,0 +1,32 @@
+package net.minecraft.src.ChemiCraft;
+
+import java.util.Random;
+
+import net.minecraft.src.*;
+
+public class ItemGasCollectingBottle extends Item {
+
+       protected ItemGasCollectingBottle(int id) {
+               super(id);
+               this.setMaxStackSize(1);
+               this.setMaxDamage(2);
+               this.setCreativeTab(CreativeTabs.tabMaterials);
+       }
+
+       @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);
+               return par1ItemStack;
+       }
+
+       @Override
+    public String getTextureFile()
+    {
+        this.isDefaultTexture = false;
+        return "/ChemiCraft/items.png";
+    }
+
+}