OSDN Git Service

finalBuild(1.5.1移行)
authormozipi <mozipi_2@yahoo.co.jp>
Sun, 21 Apr 2013 04:25:31 +0000 (13:25 +0900)
committermozipi <mozipi_2@yahoo.co.jp>
Sun, 21 Apr 2013 04:25:31 +0000 (13:25 +0900)
common/pcc/addon/crops/ChemicalCrops.java
common/pcc/chemicraft/base/ChemiCraftBase.java
common/pcc/chemicraft/base/compounds/CompoundWater.java
common/pcc/chemicraft/core/ChemiCraftAPI.java
common/pcc/chemicraft/core/ChemiCraftCore.java
common/pcc/chemicraft/core/client/ClientProxy.java
common/pcc/chemicraft/core/compounds/CompoundDebug.java [deleted file]
common/pcc/chemicraft/core/item/ItemCompounds.java
common/pcc/chemicraft/core/tileentity/TileEntityPyrolysisTable.java
common/pcc/chemicraft/util/ICompoundHandler.java

index 9261c70..2481fd2 100644 (file)
@@ -19,7 +19,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
 import cpw.mods.fml.common.network.NetworkMod;
 import cpw.mods.fml.common.registry.GameRegistry;
 
-@Mod(modid="ChemiCraft|Crops", name="ChemicalCrops(ChemiCraft-Addon)", version="v1.0.0")
+@Mod(modid="ChemiCraftCrops", name="ChemicalCrops(ChemiCraft-Addon)", version="v1.0.0")
 @NetworkMod(clientSideRequired = true, serverSideRequired = false)
 public class ChemicalCrops {
 
index 27846d3..19f8445 100644 (file)
@@ -35,14 +35,14 @@ import cpw.mods.fml.common.network.NetworkMod;
 import cpw.mods.fml.common.registry.GameRegistry;
 import cpw.mods.fml.common.registry.LanguageRegistry;
 
-@Mod(modid = "ChemiCraft|Base", name = "ChemiCraftBase", version = "Beta1")
+@Mod(modid = "ChemiCraftBase", name = "ChemiCraftBase", version = "Beta1")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftbase", packetHandler = PacketHandler.class)
 public class ChemiCraftBase extends ChemiCraft {
 
        /**
         * this is ChemiCraft instance.
         */
-       @Instance("ChemiCraft|Base")
+       @Instance("ChemiCraftBase")
        public static ChemiCraftBase instance;
 
        /**
@@ -172,7 +172,7 @@ public class ChemiCraftBase extends ChemiCraft {
         * @param event アノテーション呼び出しにより呼び出す必要なし
         */
        @PreInit
-       public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
+       public void chemiPreLoadMethod(FMLPreInitializationEvent event) {
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
                cfg.load();
 
index 3d86aec..8562c47 100644 (file)
@@ -28,8 +28,8 @@ public class CompoundWater implements ICompoundHandler {
        }
 
        @Override
-       public int getIconIndexHandler() {
-               return 1;
+       public String getIconIndexHandler() {
+               return "ChemiCraft:Composite";
        }
 
 }
index d3118fa..f1b0dfd 100644 (file)
@@ -3,6 +3,8 @@ package pcc.chemicraft.core;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.TreeMap;
 
 import net.minecraft.item.ItemStack;
 import pcc.chemicraft.ChemiCraftData;
@@ -69,6 +71,18 @@ public class ChemiCraftAPI {
 
 
        /**
+        * 化合物の英語名からダメージ値へのマップ
+        */
+       private static TreeMap<String, Integer> compoundsDamageToString = new TreeMap<String, Integer>();
+
+
+       /**
+        * 化合物のテクスチャマップ
+        */
+       private static TreeMap<Integer, String> compoundsTexture = new TreeMap<Integer, String>();
+
+
+       /**
         * List of compounds handlers.
         */
        private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
@@ -150,6 +164,7 @@ public class ChemiCraftAPI {
 
 
 
+       private static int compoundTexturePointer = 0;
        /**
         * 化合物を追加します
         * @param name 化合物の名前
@@ -157,6 +172,10 @@ public class ChemiCraftAPI {
        public static void addCompound(String name){
                ChemiCraftCore.logger.write("addCompound:" + name
                                , EnumLoggingType.INFO);
+
+               compoundsDamageToString.put(name, compoundTexturePointer);
+               compoundsTexture.put(compoundTexturePointer, "ChemiCraft:CompoundEmpty");
+               compoundTexturePointer++;
                compoundsNameListHash.add("en_US", name);
                compoundHash.put(name, compoundHash.size());
        }
@@ -392,6 +411,15 @@ public class ChemiCraftAPI {
                ChemiCraftCore.logger.write("settingCompoundHandler:" + "Name-" + handlerItemName + "/CompoundHandler-" + compoundHandler,
                                EnumLoggingType.INFO);
 
+               if (compoundHandler.getIconIndexHandler() != null) {
+                       int p = compoundsDamageToString.get(handlerItemName);
+                       if (p != -1) {
+                               compoundsTexture.put(p, compoundHandler.getIconIndexHandler());
+                       } else {
+                               System.out.println("化合物が存在しません(settingCompoundHandler)");
+                       }
+               }
+
                compoundHandlers.add(compoundHandler);
                compoundHandlerItemNames.add(handlerItemName);
        }
@@ -530,4 +558,15 @@ public class ChemiCraftAPI {
                return toolAndWeaponSharpless;
        }
 
+
+
+       public static ArrayList<String> getCompoundsTexture() {
+               Iterator<String> it = compoundsTexture.values().iterator();
+               ArrayList<String> li = new ArrayList<String>();
+               while (it.hasNext()) {
+                       li.add(it.next());
+               }
+               return li;
+       }
+
 }
index da0683f..3e80c03 100644 (file)
@@ -45,7 +45,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
  * ChemiCraft本体
  * @author P.C.C.
  */
-@Mod(modid = "ChemiCraft|Core", name = "ChemiCraft", version = "Beta1")
+@Mod(modid = "ChemiCraftCore", name = "ChemiCraft", version = "Beta1")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftcore", packetHandler = PacketHandler.class)
 public class ChemiCraftCore extends ChemiCraft{
 
@@ -76,7 +76,7 @@ public class ChemiCraftCore extends ChemiCraft{
        /**
         * this is ChemiCraft instance.
         */
-       @Instance("ChemiCraft|Core")
+       @Instance("ChemiCraftCore")
        public static ChemiCraftCore instance;
 
        /**
@@ -169,7 +169,7 @@ public class ChemiCraftCore extends ChemiCraft{
         * @param event アノテーション呼び出しにより呼び出す必要なし
         */
        @PreInit
-       public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
+       public void chemiPreLoadMethod(FMLPreInitializationEvent event) {
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
                cfg.load();
 
index aea2503..b7e9d58 100644 (file)
@@ -26,7 +26,6 @@ public class ClientProxy extends CommonProxy {
 
        @Override
        public void registerRenderInformation() {
-               MinecraftForgeClient.preloadTexture(ChemiCraft.TEXTURE);
                MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_PYROLYSIS_TEXTURE);
                MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_ELECTROLYSIS_TEXTURE);
                MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_CHEMICALCOMBINATION_TEXTURE);
diff --git a/common/pcc/chemicraft/core/compounds/CompoundDebug.java b/common/pcc/chemicraft/core/compounds/CompoundDebug.java
deleted file mode 100644 (file)
index 6d88389..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package pcc.chemicraft.core.compounds;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityLargeFireball;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import pcc.chemicraft.util.ICompoundHandler;
-
-public class CompoundDebug implements ICompoundHandler {
-
-       @Override
-       public ItemStack onItemRightClickHandler(ItemStack par1ItemStack,
-                       World par2World, EntityPlayer par3EntityPlayer) {
-               if (!par2World.isRemote) {
-                       double var1 = par3EntityPlayer.posX;
-                       double var2 = par3EntityPlayer.posY + 10;
-                       double var3 = par3EntityPlayer.posZ;
-                       double var4 = par3EntityPlayer.posX;
-                       double var5 = par3EntityPlayer.posY;
-                       double var6 = par3EntityPlayer.posZ;
-                       par2World.spawnEntityInWorld(new EntityLargeFireball(par2World, var1, var2, var3, var4, var5, var6));
-               }
-               return par1ItemStack;
-       }
-
-       @Override
-       public boolean onItemUseHandler(ItemStack par1ItemStack,
-                       EntityPlayer par2EntityPlayer, World par3World, int par4, int par5,
-                       int par6, int par7, float par8, float par9, float par10) {
-               return false;
-       }
-
-       @Override
-       public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
-                       Entity par3Entity, int par4, boolean par5) {
-
-       }
-
-       @Override
-       public int getIconIndexHandler() {
-               return 0;
-       }
-
-}
index 436e5c2..567bdcb 100644 (file)
@@ -1,5 +1,6 @@
 package pcc.chemicraft.core.item;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import net.minecraft.client.renderer.texture.IconRegister;
@@ -10,7 +11,6 @@ import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.Icon;
 import net.minecraft.world.World;
-import pcc.chemicraft.ChemiCraft;
 import pcc.chemicraft.core.ChemiCraftAPI;
 import pcc.chemicraft.core.ChemiCraftCore;
 import cpw.mods.fml.relauncher.Side;
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
 
 public class ItemCompounds extends Item {
 
-       public Icon[] icons;
+       private Icon[] icons;
 
        public ItemCompounds(int par1){
                super(par1);
@@ -43,8 +43,7 @@ public class ItemCompounds extends Item {
 
 
        @Override
-       public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
-       {
+       public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
                                if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
@@ -60,7 +59,7 @@ public class ItemCompounds extends Item {
 
 
        @Override
-       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
+       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
                try {
                        for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
                                if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
@@ -87,14 +86,6 @@ public class ItemCompounds extends Item {
 
 
        @Override
-       @SideOnly(Side.CLIENT)
-       public Icon getIconFromDamage(int par1) {
-               return this.icons[par1];
-       }
-
-
-
-       @Override
        public String getUnlocalizedName(ItemStack par1ItemStack){
                return super.getUnlocalizedName() + "." + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", par1ItemStack.getItemDamage());
        }
@@ -104,11 +95,17 @@ public class ItemCompounds extends Item {
        @Override
        @SideOnly(Side.CLIENT)
        public void updateIcons(IconRegister par1IconRegister) {
-               this.icons = new Icon[ChemiCraftCore.instance.api.getCompoundsName().sizeElementsList("en_US")];
-
-               for (int i = 0; i < ChemiCraftCore.instance.api.getCompoundsName().sizeElementsList("en_US"); i++) {
-                       this.icons[i] = par1IconRegister.registerIcon(ChemiCraft.TEXTURE + "compounds_" + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", i));
+               ArrayList<String> textures = ChemiCraftAPI.getCompoundsTexture();
+               this.icons = new Icon[textures.size()];
+               for (int i = 0; i < textures.size(); i++) {
+                       this.icons[i] = par1IconRegister.registerIcon(textures.get(i));
                }
        }
 
+       @Override
+       @SideOnly(Side.CLIENT)
+       public Icon getIconFromDamage(int par1) {
+               return this.icons[par1];
+       }
+
 }
index f1e1369..6e60b61 100644 (file)
@@ -66,9 +66,6 @@ public class TileEntityPyrolysisTable extends TileEntity {
 
        @Override
        public void updateEntity() {
-
-               System.out.println("完成時間:" + (MAX_BURN_TIME / (10 * (this.heat / CENTER_HEAT))) / 20 + "seconds");
-
                // boolean var2 = false;
 
                boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
index 76fd87c..a062af5 100644 (file)
@@ -52,6 +52,6 @@ public interface ICompoundHandler {
         * iconIndexの指定
         * @return iconIndex
         */
-       public int getIconIndexHandler();
+       public String getIconIndexHandler();
 
 }