OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
authorponkotate <ponkotate@users.sourceforge.jp>
Wed, 17 Apr 2013 16:00:00 +0000 (01:00 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Wed, 17 Apr 2013 16:00:00 +0000 (01:00 +0900)
Conflicts:
common/pcc/chemicraft/base/ChemiCraftBase.java
common/pcc/chemicraft/base/ChemiCraftRegisterItem.java

1  2 
common/pcc/chemicraft/base/ChemiCraftBase.java
common/pcc/chemicraft/base/ChemiCraftRegisterBaseRecipe.java
common/pcc/chemicraft/base/ChemiCraftRegisterItem.java

@@@ -57,18 -57,18 +57,19 @@@ public class ChemiCraftBase extends Che
        /**
         * CreativeTab of ChemiCraft.
         */
 -      public static final CreativeTabs creativeTabAtomsOre = new CreativeTabAtomOres("AtomsOre");
 +      public static final CreativeTabs creativeTabAtomOres = new CreativeTabAtomOres("AtomOres");
  
        /**
         * the ItemID.
         */
 +      public int atomIngotsID;
        public int atomGrenadeID;
        public int blackSmokeID;
 +      public int oreSerarcherID;
        public int dustID;
        public int radiationGunID;
        public int radiationBalletID;
 -      public int oreSerarcherID;
+       public int raditionGunDataChipID;
  
        /**
         * the BlockID.
        /**
         * Variables of Item type.
         */
 +      public Item itemAtomIngots;
        public Item itemAtomGrenade;
        public Item itemBlackSmoke;
        public Item itemDust;
        public Item itemRadiationGun;
        public Item itemRadiationBallet;
        public Item itemOreSearcher;
+       public Item itemRaditionGunDataChip;
  
        /**
         * the Register Instances.
        public ChemiCraftRegister registerEntitys;
  
        /**
-        * the Textures
+        * the Textures.
         */
 -      public static final String ORE = ChemiCraft.TEXTURE + "atoms_ore_";
 +      public static final String INGOT = ChemiCraft.TEXTURE + "atom_ingots_";
 +      public static final String ORE = ChemiCraft.TEXTURE + "atom_ores_";
  
        public ChemiCraftBase() {
                this.registerCompounds = new ChemiCraftRegisterCompounds(this);
                        this.atomOresID[i] = ccfgBlock.additionID();
                }
  
 +              this.atomIngotsID = ccfgItem.additionID();
                this.atomGrenadeID = ccfgItem.additionID();
                this.dustID = ccfgItem.additionID();
                this.radiationGunID = ccfgItem.additionID();
                // API用の処理
                for (int i = 0; i < this.apiBase.getAtomOres().size(); i++) {
                        OreDictionary.registerOre("ore" + this.apiBase.getAtomOresAtomName().get(i), new ItemStack(this.blockAtomOres[i / 16], 1, i % 16));
 +                      OreDictionary.registerOre("ingot" + this.apiBase.getAtomOresAtomName().get(i), new ItemStack(this.itemAtomIngots, 1, i ));
                        GameRegistry.registerWorldGenerator(this.apiBase.getAtomOres().get(i));
                }
  
                Iterator<String> langoresItr = this.apiBase.getAtomOresName().iterator();
                while (langoresItr.hasNext()){
                        String lang = langoresItr.next();
 -                      ArrayList<String> names = this.apiBase.getAtomOresName().get(lang);
 -                      for (int i = 0; i < names.size(); i++) {
 -                              ChemiCraftCore.logger.write("AtomOresAddName:" + "Name-" + names.get(i) + "ID-" + (i / 16)+ "/Damage-" + (i - i / 16 * 16) + "/Lang-" + lang,
 +                      ArrayList<String> oresName = this.apiBase.getAtomOresName().get(lang);
 +                      ArrayList<String> ingotsName = this.apiBase.getAtomIngotsName().get(lang);
 +                      for (int i = 0; i < oresName.size(); i++) {
 +                              ChemiCraftCore.logger.write("AtomOresAddName:" + "IngotName-" + ingotsName.get(i) + "OreName-" + oresName.get(i) + "ID-" + (i / 16)+ "/Damage-" + (i - i / 16 * 16) + "/Lang-" + lang,
                                                EnumLoggingType.INFO);
  
                                LanguageRegistry.instance().addNameForObject(
                                                new ItemStack(this.atomOresID[i / 16], 1, i % 16),
                                                lang,
 -                                              names.get(i)
 +                                              oresName.get(i)
 +                                              );
 +
 +                              /*
 +                              LanguageRegistry.instance().addNameForObject(
 +                                              new ItemStack(this.atomIngotsID, 1, i),
 +                                              lang,
 +                                              ingotsName.get(i)
                                                );
 +                                              */
                        }
                }
  
@@@ -6,6 -6,8 +6,8 @@@ import net.minecraft.block.Block
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemStack;
  import net.minecraftforge.oredict.OreDictionary;
+ import pcc.chemicraft.ChemiCraftData;
+ import pcc.chemicraft.core.ChemiCraftAPI;
  import pcc.chemicraft.core.ChemiCraftCore;
  import pcc.chemicraft.core.nbt.NBTRecipeGrenade;
  import pcc.chemicraft.util.Formula;
@@@ -22,7 -24,6 +24,7 @@@ public class ChemiCraftRegisterBaseReci
  
        @Override
        public void start() {
 +
                //化合物のレシピ
                this.mod.api.addChemicalCombinationRecipe(
                                new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("SodiumChloride")),
                this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.sugar),
                                new Formula("C12H22O11"));
  
 -              this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.bucketWater),
 +              this.mod.api.addReversibleOfElectrolysis(new ItemStack(Item.bucketWater),
                                new Formula("H2O"));
  
 -              this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
 +              this.mod.api.addReversibleOfElectrolysis(new ItemStack(Item.potion, 1, 0),
                                new Formula("H2O"));
  
                this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
                this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.coal),
                                new Formula("C"));
  
 +              this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreIron),
 +                              new Formula("Fe"));
 +
 +              this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotIron),
 +                              new Formula("Fe"));
 +
 +              this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.blockSteel),
 +                              new Formula("9Fe"));
 +
 +              this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreGold),
 +                              new Formula("Au"));
 +
 +              this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotGold),
 +                              new Formula("Au"));
 +
 +              this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.blockGold),
 +                              new Formula("9Au"));
 +
                this.mod.api.addReversibleOfElectrolysis(new ItemStack(Block.wood),
                                new Formula("C6H10O5"));
  
                //素材制作台のレシピ
                this.mod.api.addMaterialRecipe(
                                new ItemStack[] {
-                                               null,
-                                               new ItemStack(Block.stone),
-                                               null,
-                                               new ItemStack(Block.stone),
-                                               new ItemStack(Item.gunpowder),
-                                               new ItemStack(Block.stone),
-                                               null,
-                                               new ItemStack(Block.stone),
-                                               null
+                                               null, new ItemStack(Block.stone), null,
+                                               new ItemStack(Block.stone), new ItemStack(Item.gunpowder), new ItemStack(Block.stone),
+                                               null, new ItemStack(Block.stone), null
                                },
                                new ItemStack(this.mod.itemAtomGrenade, 16, 0),
                                new NBTRecipeGrenade());
                                new NBTRecipeGrenade()
                                );
  
+               ChemiCraftAPI.addMaterialRecipe(
+                               new ItemStack[] {
+                                               new ItemStack(Block.stone), new ItemStack(Item.ingotIron), new ItemStack(Block.stone),
+                                               new ItemStack(Item.ingotIron), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Item.ingotIron),
+                                               new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
+                               },
+                               new ItemStack(this.mod.itemRadiationBallet),
+                               null);
+               ChemiCraftAPI.addMaterialRecipe(
+                               new ItemStack[] {
+                                               new ItemStack(Block.stone), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Block.stone),
+                                               new ItemStack(Item.ingotIron), new ItemStack(Item.redstone), new ItemStack(Item.ingotIron),
+                                               new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
+                               },
+                               new ItemStack(this.mod.itemRaditionGunDataChip),
+                               null);
+               ChemiCraftAPI.addMaterialRecipe(
+                               new ItemStack[]{
+                                               new ItemStack(Block.blockSteel), new ItemStack(Block.blockSteel), new ItemStack(this.mod.itemRaditionGunDataChip),
+                                               null, null, new ItemStack(Block.stone),
+                                               null, null, new ItemStack(Item.stick)
+                               },
+                               new ItemStack(this.mod.itemRadiationGun),
+                               null);
                //分解台のレシピ
                this.mod.api.addElectrolysisDecompositionRecipe(
                                new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("Water")),
  
                //鉱石分解の追加
                Iterator<String> arrayOreNames = this.mod.apiBase.getAtomOresFormulas().keySet().iterator();
 -              while (arrayOreNames.hasNext()) {
 +              for (int i = 0; arrayOreNames.hasNext(); i++) {
                        String name = arrayOreNames.next();
 -                      ItemStack itemstack;
 +                      ItemStack ingot;
 +                      ItemStack ore;
                        try {
 -                                      itemstack = OreDictionary.getOres(name).get(0);
 +                              ingot = OreDictionary.getOres("ingot" + name).get(0);
 +                              ore = OreDictionary.getOres("ore" + name).get(0);
                        } catch (IndexOutOfBoundsException e) {
                                int var1 = this.mod.apiBase.getAtomOresAtomName().indexOf(name);
 -                              itemstack = new ItemStack(this.mod.blockAtomOres[var1 / 16], 1, var1 % 16);
 +                              ingot = new ItemStack(this.mod.itemAtomIngots, 1, i);
 +                              ore = new ItemStack(this.mod.blockAtomOres[var1 / 16], 1, var1 % 16);
                        }
                        this.mod.api.addPyrolysisDecompositionRecipe(
 -                                      itemstack,
 +                                      ingot,
 +                                      this.mod.apiBase.getAtomOresFormulas().get(name));
 +                      this.mod.api.addPyrolysisDecompositionRecipe(
 +                                      ore,
                                        this.mod.apiBase.getAtomOresFormulas().get(name));
                }
        }
@@@ -1,12 -1,16 +1,15 @@@
  package pcc.chemicraft.base;
  
+ import net.minecraft.client.renderer.texture.IconRegister;
+ import net.minecraft.item.Item;
+ import pcc.chemicraft.ChemiCraft;
  import pcc.chemicraft.base.item.ItemAtomsGrenade;
  import pcc.chemicraft.base.item.ItemBlackSmoke;
  import pcc.chemicraft.base.item.ItemDust;
  import pcc.chemicraft.base.item.ItemOreSerarcher;
  import pcc.chemicraft.base.item.ItemRadiationBullet;
  import pcc.chemicraft.base.item.ItemRadiationGun;
 -import pcc.chemicraft.util.Auxiliary;
 -import pcc.chemicraft.util.Auxiliary.NameAuxiliary;
 +import pcc.chemicraft.base.ore.ItemAtomIngots;
  
  /**
   * アイテムを追加します
@@@ -21,27 -25,34 +24,35 @@@ public class ChemiCraftRegisterItem ext
        @Override
        public void start() {
                //アイテムを変数に代入
 +              this.mod.itemAtomIngots = new ItemAtomIngots(this.mod.atomIngotsID).setUnlocalizedName("atomIngots");
                this.mod.itemAtomGrenade = new ItemAtomsGrenade(this.mod.atomGrenadeID).setUnlocalizedName("AtomsGrenade");
 +              this.mod.itemBlackSmoke = new ItemBlackSmoke(this.mod.blackSmokeID).setUnlocalizedName("BlackSmoke");
                this.mod.itemDust = new ItemDust(this.mod.dustID).setUnlocalizedName("dust");
 +              this.mod.itemOreSearcher = new ItemOreSerarcher(this.mod.oreSerarcherID).setUnlocalizedName("oreSearcher");
                this.mod.itemRadiationGun = new ItemRadiationGun(this.mod.radiationGunID).setUnlocalizedName("RadiationGun");
                this.mod.itemRadiationBallet = new ItemRadiationBullet(this.mod.radiationBalletID).setUnlocalizedName("RadiationBullet");
 -              this.mod.itemBlackSmoke = new ItemBlackSmoke(this.mod.blackSmokeID).setUnlocalizedName("BlackSmoke");
 -              this.mod.itemOreSearcher = new ItemOreSerarcher(this.mod.oreSerarcherID).setUnlocalizedName("oreSearcher");
+               this.mod.itemRaditionGunDataChip = new Item(this.mod.raditionGunDataChipID) {
+                       @Override
+                       public void updateIcons(IconRegister par1IconRegister) {
+                               this.iconIndex = par1IconRegister.registerIcon(ChemiCraft.TEXTURE + "RaditionGunDataChip");
+                       }
+               }.setUnlocalizedName("RaditionGunDataChip");
  
                //名前を登録&Minecraftに登録
                this.mod.nameAuxiliary.addName(this.mod.itemAtomGrenade, "AtomGrenade");
                this.mod.nameAuxiliary.addName(this.mod.itemAtomGrenade, "ja_JP", "元素手榴弾");
 +              this.mod.nameAuxiliary.addName(this.mod.itemBlackSmoke, "BlackSmoke");
 +              this.mod.nameAuxiliary.addName(this.mod.itemBlackSmoke, "ja_JP", "黒煙");
                this.mod.nameAuxiliary.addName(this.mod.itemDust, "dust");
                this.mod.nameAuxiliary.addName(this.mod.itemDust, "ja_JP", "粉塵");
 +              this.mod.nameAuxiliary.addName(this.mod.itemOreSearcher, "OreSearcher");
 +              this.mod.nameAuxiliary.addName(this.mod.itemOreSearcher, "ja_JP", "鉱石情報探知機");
                this.mod.nameAuxiliary.addName(this.mod.itemRadiationGun, "RadiationGun");
                this.mod.nameAuxiliary.addName(this.mod.itemRadiationGun, "ja_JP", "放射線銃");
                this.mod.nameAuxiliary.addName(this.mod.itemRadiationBallet, "RadiationBullet");
                this.mod.nameAuxiliary.addName(this.mod.itemRadiationGun, "ja_JP", "放射線弾");
 -              this.mod.nameAuxiliary.addName(this.mod.itemBlackSmoke, "BlackSmoke");
 -              this.mod.nameAuxiliary.addName(this.mod.itemBlackSmoke, "ja_JP", "黒煙");
 -              this.mod.nameAuxiliary.addName(this.mod.itemOreSearcher, "OreSearcher");
 -              this.mod.nameAuxiliary.addName(this.mod.itemOreSearcher, "ja_JP", "鉱石情報探知機");
+               this.mod.nameAuxiliary.addName(this.mod.itemRaditionGunDataChip, "RaditionGunDataChip");
+               this.mod.nameAuxiliary.addName(this.mod.itemRaditionGunDataChip, "ja_JP", "放射線銃データチップ");
        }
  
  }