//既存物のレシピ
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"));
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),
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(
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;
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;
/**
* アイテムを追加します
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;
}
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);
- /*めんどくさいから発案者やって(´・ω・`) --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;
}
- */
}