OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft
authormozipi <mozipi@users.sourceforge.jp>
Thu, 3 Jan 2013 14:17:00 +0000 (23:17 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Thu, 3 Jan 2013 14:17:00 +0000 (23:17 +0900)
Conflicts:
common/chemicraft/ChemiCraft.java

common/chemicraft/ChemiCraft.java
common/chemicraft/ChemiCraftAPI.java
common/chemicraft/item/ItemAtomsGrenade.java [moved from common/chemicraft/item/ItemAtomGrenade.java with 94% similarity]
common/chemicraft/item/ItemGasCollectingBottle.java
common/chemicraft/render/RenderAtomsGrenade.java

index 357baa7..94ad8f5 100644 (file)
@@ -15,9 +15,8 @@ import chemicraft.compounds.CompoundWater;
 import chemicraft.debug.CommandDeleteItem;\r
 import chemicraft.debug.CommandGenDebugRoom;\r
 import chemicraft.debug.CommandSetTile;\r
-import chemicraft.entity.EntityAtomsGrenade;\r
-import chemicraft.item.ItemAtomGrenade;\r
 import chemicraft.item.ItemAtoms;\r
+import chemicraft.item.ItemAtomsGrenade;\r
 import chemicraft.item.ItemCompounds;\r
 import chemicraft.item.ItemGasCollectingBottle;\r
 import chemicraft.system.CommonProxy;\r
@@ -38,7 +37,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
 import cpw.mods.fml.common.event.FMLServerStartingEvent;\r
 import cpw.mods.fml.common.network.NetworkMod;\r
 import cpw.mods.fml.common.network.NetworkRegistry;\r
-import cpw.mods.fml.common.registry.EntityRegistry;\r
 import cpw.mods.fml.common.registry.GameRegistry;\r
 \r
 /**\r
@@ -228,7 +226,7 @@ public class ChemiCraft {
                this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");\r
                this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");\r
                this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);\r
-               this.itemAtomGrenade = new ItemAtomGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);\r
+               this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);\r
 \r
                // BlockをMinecraftに登録します\r
                GameRegistry.registerBlock(this.blockDecompositionTable);\r
@@ -302,7 +300,11 @@ public class ChemiCraft {
 \r
                // 化合物を追加します\r
                api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
-               api.addLangCompound("ja_JP", "Water", "水");\r
+               api.addLangCompound("ja_JP", "Water", "水");
+               ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");\r
+               ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
+               ChemiCraftAPI.getInstance().addLangCompound("ja_JP", "Water", "水");\r
+
 \r
                //化合物のHandlerを設定します\r
                api.settingCompoundHandler("Water", new CompoundWater());\r
@@ -332,6 +334,7 @@ public class ChemiCraft {
                // API用の処理\r
                this.nameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getInstance().getCompoundsName().toArray());\r
                this.nameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getInstance().getCompoundsLangName().toArray());\r
+               ChemiCraftAPI.getInstance().addCompoundHash(ChemiCraftAPI.getInstance().getCompoundsName().toArray());\r
        }\r
 \r
        private void debug(final FMLPostInitializationEvent event) {\r
index 330e1c0..ca54c3e 100644 (file)
@@ -131,7 +131,6 @@ public class ChemiCraftAPI {
        public int getDamageByName(String englishName){
                for(int i = 0;i < compoundsNameList.size();i++){
                        if(englishName.equals(compoundsNameList.get(i))){
-                               compoundHash.put(englishName, i);
                                return i;
                        }
                }
@@ -140,6 +139,22 @@ public class ChemiCraftAPI {
 
 
 
+       public void addCompoundHash(String key, int value){
+               compoundHash.put(key, value);
+       }
+
+
+
+       public void addCompoundHash(Object[] object){
+               for(int i = 0;i < compoundsNameList.size();i++){
+                       if(object[i].equals(compoundsNameList.get(i))){
+                               compoundHash.put((String) object[i], i);
+                       }
+               }
+       }
+
+
+
        public int getCompound(String key){
                if(compoundHash.get(key) != null){
                        return compoundHash.get(key);
similarity index 94%
rename from common/chemicraft/item/ItemAtomGrenade.java
rename to common/chemicraft/item/ItemAtomsGrenade.java
index 06d31c3..1dcfda9 100644 (file)
@@ -2,7 +2,8 @@ package chemicraft.item;
 
 import java.util.List;
 
-import net.minecraft.src.Entity;
+import chemicraft.entity.EntityAtomsGrenade;
+
 import net.minecraft.src.EntityPlayer;
 import net.minecraft.src.Item;
 import net.minecraft.src.ItemStack;
@@ -13,9 +14,9 @@ import net.minecraft.src.WorldClient;
 import net.minecraft.src.WorldServer;
 import chemicraft.entity.EntityAtomsGrenade;
 
-public class ItemAtomGrenade extends Item {
+public class ItemAtomsGrenade extends Item {
 
-       public ItemAtomGrenade(int par1) {
+       public ItemAtomsGrenade(int par1) {
                super(par1);
        }
 
index 8f07fa6..49ef396 100644 (file)
@@ -71,10 +71,13 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
        @Override
        public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
        {
-               int var11 = par3World.getBlockId(par4, par5, par6);
-               Block block = Block.blocksList[var11];
+               int blockID = par3World.getBlockId(par4, par5, par6);
+               Block block = Block.blocksList[blockID];
 
-               if (block instanceof BlockFire){
+               int uniqueBlockID = par3World.getBlockId(par4, par5 + 1, par6);
+               Block uniqueBlock = Block.blocksList[uniqueBlockID];
+
+               if (uniqueBlock instanceof BlockFire){
                        par1ItemStack.damageItem(1, par2EntityPlayer);
 
                        int result1 = MathHelperPlus.probability(99, 1);
@@ -82,7 +85,7 @@ public class ItemGasCollectingBottle extends ItemAtomInfoContainer
                        if (result1 == 0) {
                                this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonDioxide")), par2EntityPlayer);
                        } else {
-                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemAtoms, 1, 17), par2EntityPlayer);
+                               this.isStackOrDrop(new ItemStack(ChemiCraft.instance.itemCompounds, 1, ChemiCraftAPI.getInstance().getCompound("CarbonMonoxide")), par2EntityPlayer);
                        }
 
                        return true;
index 161f99e..52d8815 100644 (file)
@@ -9,7 +9,10 @@ import org.lwjgl.opengl.GL12;
 
 import chemicraft.ChemiCraft;
 import chemicraft.entity.EntityAtomsGrenade;
+import cpw.mods.fml.common.Side;
+import cpw.mods.fml.common.asm.SideOnly;
 
+@SideOnly(Side.CLIENT)
 public class RenderAtomsGrenade extends Render {
 
        private float field_77002_a;