OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ChemiCraftBase.java
index 8e05e8e..b4275c2 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,30 +10,27 @@ 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;
 import pcc.chemicraft.EnumLoggingType;
 import pcc.chemicraft.base.creativetab.CreativeTabAtomOres;
-import pcc.chemicraft.base.gen.WorldGenAtomsOre;
 import pcc.chemicraft.base.system.CommonProxy;
 import pcc.chemicraft.base.system.PacketHandler;
 import pcc.chemicraft.core.ChemiCraftAPI;
 import pcc.chemicraft.core.ChemiCraftCore;
 import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.Mod;
-import cpw.mods.fml.common.ModContainer;
 import cpw.mods.fml.common.LoaderState.ModState;
+import cpw.mods.fml.common.Mod;
 import cpw.mods.fml.common.Mod.Instance;
 import cpw.mods.fml.common.Mod.PostInit;
 import cpw.mods.fml.common.Mod.PreInit;
+import cpw.mods.fml.common.ModContainer;
 import cpw.mods.fml.common.SidedProxy;
-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 = "ChemiCraftBase", name = "ChemiCraftBase", version = "beta1")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.7", channels = "chemicraftbase", packetHandler = PacketHandler.class)
@@ -101,6 +100,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);
@@ -198,20 +202,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));
                        }
                }
        }