OSDN Git Service

ソース参照
authorponkotate <ponkotate@users.sourceforge.jp>
Sat, 20 Apr 2013 09:05:40 +0000 (18:05 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sat, 20 Apr 2013 09:05:40 +0000 (18:05 +0900)
common/pcc/chemicraft/base/ChemiCraftRegisterBaseRecipe.java
common/pcc/chemicraft/core/ChemiCraftRegisterItem.java
common/pcc/chemicraft/core/item/ItemCompounds.java

index 049fab4..be67f7a 100644 (file)
@@ -36,7 +36,7 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
 
                //既存物のレシピ
                this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.diamond),
-                               new Formula("C64Si16"));
+                               new Formula("C4096Si64"));
 
                this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.sugar),
                                new Formula("C12H22O11"));
@@ -47,25 +47,25 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                this.mod.api.addReversibleOfElectrolysis(new ItemStack(Item.potion, 1, 0),
                                new Formula("H2O"));
 
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
-                               new Formula("C"));
-
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.coal),
+                               new Formula("C64"));
+
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
                                new Formula("C"));
 
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreIron),
+               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.ingotIron),
                                new Formula("Fe"));
 
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotIron),
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreIron),
                                new Formula("Fe"));
 
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.blockSteel),
                                new Formula("9Fe"));
 
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreGold),
+               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.ingotGold),
                                new Formula("Au"));
 
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotGold),
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreGold),
                                new Formula("Au"));
 
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.blockGold),
@@ -89,12 +89,10 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald),
                                new Formula("Be3Al2Si6O18"));
 
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreEmerald),
+                               new Formula("Be3Al2Si6O18"));
+
 
-               //他MOD使用時のレシピ
-               //RP2-------------------------------------------------------------------------------------------------------------
-               this.mod.api.addPyrolysisDecompositionRecipe(
-                               OreDictionary.getOres("oreCopper"), new Formula("Cu"));
-               //------------------------------------------------------------------------------------------------------------------
 
                //素材制作台のレシピ
                this.mod.api.addMaterialRecipe(
index 9a37774..f5d5889 100644 (file)
@@ -1,5 +1,6 @@
 package pcc.chemicraft.core;
 
+import net.minecraft.client.renderer.texture.IconRegister;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.ItemFood;
 import net.minecraft.item.ItemStack;
@@ -8,6 +9,8 @@ import pcc.chemicraft.core.item.ItemAtoms;
 import pcc.chemicraft.core.item.ItemChemicalCell;
 import pcc.chemicraft.core.item.ItemCompounds;
 import pcc.chemicraft.core.item.ItemGasCollectingBottle;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
 
 /**
  * アイテムを追加します
@@ -27,6 +30,12 @@ public class ChemiCraftRegisterItem extends ChemiCraftCoreRegister {
                this.mod.itemGasCollectingBottle = new ItemGasCollectingBottle(this.mod.gasCollectingBottleID).setUnlocalizedName("gasCollectingBottle");
                this.mod.itemChemicalCells = new ItemChemicalCell(this.mod.chemicalCellsID).setUnlocalizedName("chemicalCell");
                this.mod.itemPear = new ItemFood(this.mod.pearID, 4, 0.4F, false){
+                       @Override
+                       @SideOnly(Side.CLIENT)
+                       public void updateIcons(IconRegister par1IconRegister) {
+                               this.iconIndex = par1IconRegister.registerIcon("appleGold");
+                       }
+                       @Override
                        public int getColorFromItemStack(ItemStack par1ItemStack,int par2){
                                return 0x66FF66;
                                }
index 2a36838..436e5c2 100644 (file)
@@ -1,15 +1,25 @@
 package pcc.chemicraft.core.item;
 
+import java.util.List;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.entity.Entity;
 import net.minecraft.entity.player.EntityPlayer;
 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;
+import cpw.mods.fml.relauncher.SideOnly;
 
 public class ItemCompounds extends Item {
 
+       public Icon[] icons;
+
        public ItemCompounds(int par1){
                super(par1);
                this.setHasSubtypes(true);
@@ -65,52 +75,40 @@ public class ItemCompounds extends Item {
 
 
 
-       /*めんどくさいから発案者やって(´・ω・`) --WIP--
        @SuppressWarnings({ "unchecked", "rawtypes" })
        @SideOnly(Side.CLIENT)
        @Override
        public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
                for(int type = 0; type < ChemiCraftAPI.instance().getCompoundsName().get("en_US").size(); type++) {
                        par3List.add(new ItemStack(par1, 1, type));
-                       this.setIconIndex(type);
                }
        }
 
 
 
        @Override
-       public String getItemNameIS(ItemStack par1ItemStack){
-               try {
-                       return super.getItemName() + "." + ChemiCraftAPI.instance().getCompoundsName().get("en_US", par1ItemStack.getItemDamage());
-               } catch (ArrayIndexOutOfBoundsException e) {
-                       par1ItemStack.stackSize = 0;
-               }
-               return null;
+       @SideOnly(Side.CLIENT)
+       public Icon getIconFromDamage(int par1) {
+               return this.icons[par1];
        }
 
 
 
        @Override
-       public String getTextureFile(){
-               return ChemiCraft.ITEM_COMPOUNDS_TEXTURE;
+       public String getUnlocalizedName(ItemStack par1ItemStack){
+               return super.getUnlocalizedName() + "." + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", par1ItemStack.getItemDamage());
        }
 
 
 
-       @SideOnly(Side.CLIENT)
        @Override
-       public int getIconFromDamage(int par1){
-               try {
-                       for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
-                               if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
-                                       return ChemiCraftAPI.instance().getCompoundHandler().get(i).getIconIndexHandler();
-                               }
-                       }
-               } catch (IndexOutOfBoundsException e) {
-                       return 0;
+       @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));
                }
-               return 0;
        }
-       */
 
 }