OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ChemiCraftBase.java
index 98201ed..29788e0 100644 (file)
@@ -1,5 +1,7 @@
 package pcc.chemicraft.base;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import net.minecraft.block.Block;
@@ -8,7 +10,6 @@ import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraftforge.common.Configuration;
 import net.minecraftforge.common.Property;
-import net.minecraftforge.oredict.OreDictionary;
 import pcc.chemicraft.ChemiCraft;
 import pcc.chemicraft.ChemiCraftConfiguration;
 import pcc.chemicraft.ChemiCraftRegister;
@@ -28,7 +29,7 @@ import cpw.mods.fml.common.SidedProxy;
 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 = "ChemiCraftBase", name = "ChemiCraftBase", version = "beta1")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.7", channels = "chemicraftbase", packetHandler = PacketHandler.class)
@@ -97,6 +98,11 @@ public class ChemiCraftBase extends ChemiCraft {
        public ChemiCraftRegister registerRecipe;
        public ChemiCraftRegister registerEntitys;
 
+       /**
+        * the Textures
+        */
+       public static final String ORE = ChemiCraft.TEXTURE + "AtomsOre_";
+
        public ChemiCraftBase() {
                this.registerCompounds = new ChemiCraftRegisterCompounds(this);
                this.registerCompoundsHandler = new ChemiCraftRegisterCompoundsHandler(this);
@@ -194,20 +200,18 @@ public class ChemiCraftBase extends ChemiCraft {
 
        private void apiProcessing(final FMLPostInitializationEvent event) {
                // API用の処理
-               for (int i = 0; i < apiBase.getAtomOresName().sizeKeysList(); i++) {
-                       for (int j = 0; j < apiBase.getAtomOresName().sizeElementsList(apiBase.getAtomOresName().getKeyList(i)); j++) {
-                               ChemiCraftCore.logger.write("OreAddName:" + "Name-" + apiBase.getAtomOresName().get(apiBase.getAtomOresName().getKeyList(i), j) +
-                                               "/Lang-" + apiBase.getAtomOresLanguage().get(apiBase.getAtomOresName().getKeyList(i), j),
+               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) + "/Damage-" + (i - i / 16 * 16) + "/Lang-" + lang,
                                                EnumLoggingType.INFO);
 
-                               this.nameAuxiliary.addName(
-                                               new ItemStack(
-                                                               blockAtomOres[i / 16], 0, i - i / 16 * 16),
-                                                               apiBase.getAtomOresLanguage().get(apiBase.getAtomOresName().getKeyList(i), j),
-                                                               apiBase.getAtomOresName().get(apiBase.getAtomOresName().getKeyList(i), j));
-                               OreDictionary.registerOre("ore" + apiBase.getAtomOresName().getKeyList(i),
-                                               new ItemStack(blockAtomOres[i / 16], 1, i - i / 16 * 16));
-                               GameRegistry.registerWorldGenerator(apiBase.getAtomOres().get(i));
+                               LanguageRegistry.instance().addNameForObject(
+                                               new ItemStack(this.blockAtomOres[i / 16], 1, i - i / 16 * 16),
+                                               lang,
+                                               names.get(i));
                        }
                }
        }