Jump to content

Recommended Posts

Posted

Hello everyone! How would you add a crafting recipe for armor and tools? The way I am trying worked for normal items, but when I tried to use it for my armor or tools my game crashed before startup. The armor and tools works ingame when you put it on and use it and stuff, so it is not a problem with the armor or tools coding. Also, how would you add a recipe with dyes? I want the recipe for green cloth to be cactus green and cloth, but I cant find cactus green or any other dyes, only Item.dyePowder.

 

Any help would be much appreciated!

 

My Mod Code:http://pastebin.com/W9pV8Xv0

Posted

Hello everyone! How would you add a crafting recipe for armor and tools? The way I am trying worked for normal items, but when I tried to use it for my armor or tools my game crashed before startup. The armor and tools works ingame when you put it on and use it and stuff, so it is not a problem with the armor or tools coding. Also, how would you add a recipe with dyes? I want the recipe for green cloth to be cactus green and cloth, but I cant find cactus green or any other dyes, only Item.dyePowder.

 

Any help would be much appreciated!

 

My Mod Code:http://pastebin.com/W9pV8Xv0

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

 

What do you mean by that? Am I supposed to have a special class for registering tool/armor recipies specifically? If I am, please tell me how because I had no idea that you were supposed to do that.

 

Thanks for the reply!

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

 

What do you mean by that? Am I supposed to have a special class for registering tool/armor recipies specifically? If I am, please tell me how because I had no idea that you were supposed to do that.

 

Thanks for the reply!

Posted

Not sure but this might work.

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), "T T", "TTT", "TTT",
                'T', baconiteIngot);

Posted

Not sure but this might work.

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), "T T", "TTT", "TTT",
                'T', baconiteIngot);

Posted

he's asking for the code that you have for adding the armor and tools to the game. and the recipe takato gave you should work. if it doesnt make sure the item was correctly registered.

Posted

he's asking for the code that you have for adding the armor and tools to the game. and the recipe takato gave you should work. if it doesnt make sure the item was correctly registered.

Posted

he's asking for the code that you have for adding the armor and tools to the game. and the recipe takato gave you should work. if it doesnt make sure the item was correctly registered.

No that does not work. What do you mean by correctly registered? The tools and armor work fine in the game. Is there something extra I have to do to register them?

Posted

he's asking for the code that you have for adding the armor and tools to the game. and the recipe takato gave you should work. if it doesnt make sure the item was correctly registered.

No that does not work. What do you mean by correctly registered? The tools and armor work fine in the game. Is there something extra I have to do to register them?

Posted

Not sure but this might work.

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), "T T", "TTT", "TTT",
                'T', baconiteIngot);

I'm pretty sure that's exactly what I tried in my code that didn't work...

 

Your code has this:

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
                "T T", "TTT", "TTT", 'T', baconiteIngot
        });

 

Which is not exactly the same. Try getting ride of the new Object[] {} part and see if it works then.

 

I also don't see the baconiteIngot registered anywhere, so that might also be part of the issue. You should use GameRegistry.registerItem to register all of your items, just like you use GameRegistry.registerBlock to register your blocks.

Posted

Not sure but this might work.

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), "T T", "TTT", "TTT",
                'T', baconiteIngot);

I'm pretty sure that's exactly what I tried in my code that didn't work...

 

Your code has this:

GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
                "T T", "TTT", "TTT", 'T', baconiteIngot
        });

 

Which is not exactly the same. Try getting ride of the new Object[] {} part and see if it works then.

 

I also don't see the baconiteIngot registered anywhere, so that might also be part of the issue. You should use GameRegistry.registerItem to register all of your items, just like you use GameRegistry.registerBlock to register your blocks.

Posted

I don't know if it has any effect, but I would drop the amount. At least that's what I use in my mod for single items. Also try adding your basemod class in front of your item.

 

So:

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
)};

 

And also, I see you baconiteIngot registered correctly. You do need your braces too - {}.

Posted

I don't know if it has any effect, but I would drop the amount. At least that's what I use in my mod for single items. Also try adding your basemod class in front of your item.

 

So:

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
)};

 

And also, I see you baconiteIngot registered correctly. You do need your braces too - {}.

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

I don't know if it has any effect, but I would drop the amount. At least that's what I use in my mod for single items. Also try adding your basemod class in front of your item.

 

So:

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
)};

 

And also, I see you baconiteIngot registered correctly. You do need your braces too - {}.

 

Guys, I don't know if I'm just derping or what, but nothing said here is working. The strange part is that if I change baconiteChestplate to any vanilla item, or even a mod item that is not armor or a tool, the recipe works fine. I will post all of my classes so you can maybe further see what my error is. I'm fustrated that I'm having trouble with what is supposed to be the easy part!

 

Main Class (with things suggested here)

package mods.crystalia.common;


import java.lang.reflect.Proxy;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "Crystalia", name = "Crystalia", version = "Pre-Alpha 0.0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Crystalia {

@SidedProxy(clientSide = "mods.crystalia.common.ClientProxy", serverSide = "mods.crystalia.common.ServerProxy")
public static ServerProxy proxy;


//Blocks start here
public static Block baconiteOre;
int baconiteOreID = 3000;

public static Block sapphireOre;
int sapphireOreID = 3001;



//Items start here	
public static Item baconiteIngot;
public static Item cloth;
public static Item blueCloth;
public static Item greenCloth;
public static Item redCloth;
public static Item yellowCloth;
public static Item brownCloth;
public static Item blackCloth;
public static Item sapphire;
public static Item ruby;
//tools start here
public static Item baconiteBow;
public static Item pickBaconite;
public static Item axeBaconite;
public static Item swordBaconite;
public static Item hoeBaconite;
public static Item shovelBaconite;
//armor starts here
public static Item baconiteHelmet;
public static Item baconiteChestplate;
public static Item baconiteLeggings;
public static Item baconiteBoots;


@Init
public void load(FMLInitializationEvent event){
	proxy.registerRenderThings();

	baconiteOre = new BlockBaconiteOre(baconiteOreID, Material.iron).setUnlocalizedName("tilebaconiteore").setHardness(3.0F);
	sapphireOre = new BlockSapphireOre(sapphireOreID, Material.iron).setUnlocalizedName("tilesapphireore").setHardness(3.0F);



	GameRegistry.registerWorldGenerator(new WorldGeneratorCrystalia());

GameRegistry.registerBlock(baconiteOre, "baconiteore");
GameRegistry.registerBlock(sapphireOre, "sapphireore");

GameRegistry.registerItem(baconiteIngot, "baconiteingot");
GameRegistry.registerItem(baconiteChestplate, "baconitechestplate");		
	LanguageRegistry.addName(baconiteOre, "Baconite Ore");
		LanguageRegistry.addName(sapphireOre, "Sapphire Ore");


		baconiteIngot = new ItemBaconiteIngot(5000).setUnlocalizedName("baconiteIngot");
		LanguageRegistry.addName(baconiteIngot, "Baconite Ingot");
		sapphire = new ItemSapphire(5008).setUnlocalizedName("sapphire");
		LanguageRegistry.addName(sapphire, "Sapphire");
		ruby = new ItemRuby(5016).setUnlocalizedName("ruby");
		LanguageRegistry.addName(ruby, "Ruby");
		//cloth starts here. SO MUCH CLOTH!!!
		redCloth = new ItemRedCloth(5004).setUnlocalizedName("redCloth");
		cloth = new ItemCloth(5001).setUnlocalizedName("cloth");
		greenCloth = new ItemGreenCloth(5003).setUnlocalizedName("greenCloth");
		blueCloth = new ItemBlueCloth(5002).setUnlocalizedName("blueCloth");
		yellowCloth = new ItemYellowCloth(5005).setUnlocalizedName("yellowCloth");
		blackCloth = new ItemBlackCloth(5006).setUnlocalizedName("blackCloth");
		brownCloth = new ItemBrownCloth(5007).setUnlocalizedName("brownCloth");


		LanguageRegistry.addName(cloth, "Cloth");
		LanguageRegistry.addName(blueCloth, "Blue Cloth");
		LanguageRegistry.addName(greenCloth, "Green Cloth");
		LanguageRegistry.addName(redCloth, "Red Cloth");
		LanguageRegistry.addName(yellowCloth, "Yellow Cloth");
		LanguageRegistry.addName(blackCloth, "Black Cloth");
		LanguageRegistry.addName(brownCloth, "Brown Cloth");

//Smelting!!
		GameRegistry.addSmelting(baconiteOreID, new ItemStack (baconiteIngot), 0.1f); 
//Crafting
/*GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
	"T T", "TTT", "TTT", 'T', baconiteIngot
});	
*/		
		GameRegistry.addShapelessRecipe(new ItemStack(Item.silk, 4), new Object[] {
			Block.cloth
		});	

		GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
		    "T T", "TTT", "TTT",
		    'T', Crystalia.baconiteIngot,
		});
//tools
baconiteBow = new BaconiteBow(5010).setUnlocalizedName("Crystalia:baconiteBow"); 
LanguageRegistry.addName(baconiteBow, "Baconite Bow");

EnumToolMaterial BACONITE = EnumHelper.addToolMaterial("Baconite Enum", 3, 2000, 7.0F, 4, 15);
EnumArmorMaterial BACONITEA = EnumHelper.addArmorMaterial("Baconite Armor", 40, new int[]{3, 8, 6, 3}, 15);

pickBaconite = new PickaxeBaconite(5011, BACONITE).setUnlocalizedName("crystalia:pickaxeBaconite");
LanguageRegistry.addName(pickBaconite, "Baconite Pickaxe");

axeBaconite = new AxeBaconite(5012, BACONITE).setUnlocalizedName("crystalia:hatchetBaconite");
LanguageRegistry.addName(axeBaconite, "Baconite Axe");

hoeBaconite = new HoeBaconite(5013, BACONITE).setUnlocalizedName("crystalia:hoeBaconite");
LanguageRegistry.addName(hoeBaconite, "Baconite Hoe");

shovelBaconite = new ShovelBaconite(5014, BACONITE).setUnlocalizedName("crystalia:shovelBaconite");
LanguageRegistry.addName(shovelBaconite, "Baconite Shovel");

swordBaconite = new SwordBaconite(5015, BACONITE).setUnlocalizedName("crystalia:Baconite Sword");
LanguageRegistry.addName(swordBaconite, "Baconite Sword");

//armor

baconiteHelmet = new BaconiteArmor(6000, BACONITEA, proxy.addArmor("Baconite"), 0).setUnlocalizedName("BaconiteHelmet"); 
LanguageRegistry.addName(baconiteHelmet, "Baconite Helmet");

baconiteChestplate = new BaconiteArmor(6001, BACONITEA, proxy.addArmor("Baconite"), 1).setUnlocalizedName("BaconiteChestplate");
LanguageRegistry.addName(baconiteChestplate, "Baconite Chestplate");

baconiteLeggings = new BaconiteArmor(6002, BACONITEA, proxy.addArmor("Baconite"), 2).setUnlocalizedName("BaconiteLeggings");
LanguageRegistry.addName(baconiteLeggings, "Baconite Leggings");

baconiteBoots = new BaconiteArmor(6003, BACONITEA, proxy.addArmor("Baconite"), 3).setUnlocalizedName("BaconiteBoots");
LanguageRegistry.addName(baconiteBoots, "Baconite Boots");


}
}

 

BaconiteArmor Class:

package mods.crystalia.common;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;

public class BaconiteArmor extends ItemArmor implements IArmorTextureProvider{

public BaconiteArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,
		int par3, int par4) {
	super(par1, par2EnumArmorMaterial, par3, par4);
	// TODO Auto-generated constructor stub
}

@Override
public String getArmorTextureFile(ItemStack itemstack) {
	if(itemstack.itemID == Crystalia.baconiteHelmet.itemID || itemstack.itemID == Crystalia.baconiteChestplate.itemID || itemstack.itemID == Crystalia.baconiteBoots.itemID){
		return "/mods/crystalia/textures/armor/baconite_1.png";


}

	if(itemstack.itemID == Crystalia.baconiteLeggings.itemID){
		return "/mods/crystalia/textures/armor/baconite_2.png";

}
	else return null;
}

@Override
    public void updateIcons(IconRegister iconRegister)
    {
        if(this == Crystalia.baconiteHelmet)     
	this.iconIndex = iconRegister.registerIcon("crystalia:helmetBaconite");
    
    
        {
 if(this == Crystalia.baconiteChestplate)     
		this.iconIndex = iconRegister.registerIcon("crystalia:chestplateBaconite");


}
        {
if(this == Crystalia.baconiteLeggings)     
this.iconIndex = iconRegister.registerIcon("crystalia:leggingsBaconite");
        }
        {
        	 if(this == Crystalia.baconiteBoots)     
        			this.iconIndex = iconRegister.registerIcon("crystalia:bootsBaconite");	
        }
}
}

 

Baconite Axe(I did the same code for evey tool using the appropriate extends):

package mods.crystalia.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemAxe;


public class AxeBaconite extends ItemAxe {

public AxeBaconite(int par1, EnumToolMaterial par2EnumToolMaterial) {
	super(par1, par2EnumToolMaterial);
	// TODO Auto-generated constructor stub
}

}

 

If you want to see anything else, please ask! I'm really desperate to get the crafting recipes working!

 

[glow=red,2,300]Please Help!![/glow]

Posted

It would be helpful to post what code you used to register your armor/tool recipes.

I don't know if it has any effect, but I would drop the amount. At least that's what I use in my mod for single items. Also try adding your basemod class in front of your item.

 

So:

 

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
)};

 

And also, I see you baconiteIngot registered correctly. You do need your braces too - {}.

 

Guys, I don't know if I'm just derping or what, but nothing said here is working. The strange part is that if I change baconiteChestplate to any vanilla item, or even a mod item that is not armor or a tool, the recipe works fine. I will post all of my classes so you can maybe further see what my error is. I'm fustrated that I'm having trouble with what is supposed to be the easy part!

 

Main Class (with things suggested here)

package mods.crystalia.common;


import java.lang.reflect.Proxy;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "Crystalia", name = "Crystalia", version = "Pre-Alpha 0.0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Crystalia {

@SidedProxy(clientSide = "mods.crystalia.common.ClientProxy", serverSide = "mods.crystalia.common.ServerProxy")
public static ServerProxy proxy;


//Blocks start here
public static Block baconiteOre;
int baconiteOreID = 3000;

public static Block sapphireOre;
int sapphireOreID = 3001;



//Items start here	
public static Item baconiteIngot;
public static Item cloth;
public static Item blueCloth;
public static Item greenCloth;
public static Item redCloth;
public static Item yellowCloth;
public static Item brownCloth;
public static Item blackCloth;
public static Item sapphire;
public static Item ruby;
//tools start here
public static Item baconiteBow;
public static Item pickBaconite;
public static Item axeBaconite;
public static Item swordBaconite;
public static Item hoeBaconite;
public static Item shovelBaconite;
//armor starts here
public static Item baconiteHelmet;
public static Item baconiteChestplate;
public static Item baconiteLeggings;
public static Item baconiteBoots;


@Init
public void load(FMLInitializationEvent event){
	proxy.registerRenderThings();

	baconiteOre = new BlockBaconiteOre(baconiteOreID, Material.iron).setUnlocalizedName("tilebaconiteore").setHardness(3.0F);
	sapphireOre = new BlockSapphireOre(sapphireOreID, Material.iron).setUnlocalizedName("tilesapphireore").setHardness(3.0F);



	GameRegistry.registerWorldGenerator(new WorldGeneratorCrystalia());

GameRegistry.registerBlock(baconiteOre, "baconiteore");
GameRegistry.registerBlock(sapphireOre, "sapphireore");

GameRegistry.registerItem(baconiteIngot, "baconiteingot");
GameRegistry.registerItem(baconiteChestplate, "baconitechestplate");		
	LanguageRegistry.addName(baconiteOre, "Baconite Ore");
		LanguageRegistry.addName(sapphireOre, "Sapphire Ore");


		baconiteIngot = new ItemBaconiteIngot(5000).setUnlocalizedName("baconiteIngot");
		LanguageRegistry.addName(baconiteIngot, "Baconite Ingot");
		sapphire = new ItemSapphire(5008).setUnlocalizedName("sapphire");
		LanguageRegistry.addName(sapphire, "Sapphire");
		ruby = new ItemRuby(5016).setUnlocalizedName("ruby");
		LanguageRegistry.addName(ruby, "Ruby");
		//cloth starts here. SO MUCH CLOTH!!!
		redCloth = new ItemRedCloth(5004).setUnlocalizedName("redCloth");
		cloth = new ItemCloth(5001).setUnlocalizedName("cloth");
		greenCloth = new ItemGreenCloth(5003).setUnlocalizedName("greenCloth");
		blueCloth = new ItemBlueCloth(5002).setUnlocalizedName("blueCloth");
		yellowCloth = new ItemYellowCloth(5005).setUnlocalizedName("yellowCloth");
		blackCloth = new ItemBlackCloth(5006).setUnlocalizedName("blackCloth");
		brownCloth = new ItemBrownCloth(5007).setUnlocalizedName("brownCloth");


		LanguageRegistry.addName(cloth, "Cloth");
		LanguageRegistry.addName(blueCloth, "Blue Cloth");
		LanguageRegistry.addName(greenCloth, "Green Cloth");
		LanguageRegistry.addName(redCloth, "Red Cloth");
		LanguageRegistry.addName(yellowCloth, "Yellow Cloth");
		LanguageRegistry.addName(blackCloth, "Black Cloth");
		LanguageRegistry.addName(brownCloth, "Brown Cloth");

//Smelting!!
		GameRegistry.addSmelting(baconiteOreID, new ItemStack (baconiteIngot), 0.1f); 
//Crafting
/*GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
	"T T", "TTT", "TTT", 'T', baconiteIngot
});	
*/		
		GameRegistry.addShapelessRecipe(new ItemStack(Item.silk, 4), new Object[] {
			Block.cloth
		});	

		GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
		    "T T", "TTT", "TTT",
		    'T', Crystalia.baconiteIngot,
		});
//tools
baconiteBow = new BaconiteBow(5010).setUnlocalizedName("Crystalia:baconiteBow"); 
LanguageRegistry.addName(baconiteBow, "Baconite Bow");

EnumToolMaterial BACONITE = EnumHelper.addToolMaterial("Baconite Enum", 3, 2000, 7.0F, 4, 15);
EnumArmorMaterial BACONITEA = EnumHelper.addArmorMaterial("Baconite Armor", 40, new int[]{3, 8, 6, 3}, 15);

pickBaconite = new PickaxeBaconite(5011, BACONITE).setUnlocalizedName("crystalia:pickaxeBaconite");
LanguageRegistry.addName(pickBaconite, "Baconite Pickaxe");

axeBaconite = new AxeBaconite(5012, BACONITE).setUnlocalizedName("crystalia:hatchetBaconite");
LanguageRegistry.addName(axeBaconite, "Baconite Axe");

hoeBaconite = new HoeBaconite(5013, BACONITE).setUnlocalizedName("crystalia:hoeBaconite");
LanguageRegistry.addName(hoeBaconite, "Baconite Hoe");

shovelBaconite = new ShovelBaconite(5014, BACONITE).setUnlocalizedName("crystalia:shovelBaconite");
LanguageRegistry.addName(shovelBaconite, "Baconite Shovel");

swordBaconite = new SwordBaconite(5015, BACONITE).setUnlocalizedName("crystalia:Baconite Sword");
LanguageRegistry.addName(swordBaconite, "Baconite Sword");

//armor

baconiteHelmet = new BaconiteArmor(6000, BACONITEA, proxy.addArmor("Baconite"), 0).setUnlocalizedName("BaconiteHelmet"); 
LanguageRegistry.addName(baconiteHelmet, "Baconite Helmet");

baconiteChestplate = new BaconiteArmor(6001, BACONITEA, proxy.addArmor("Baconite"), 1).setUnlocalizedName("BaconiteChestplate");
LanguageRegistry.addName(baconiteChestplate, "Baconite Chestplate");

baconiteLeggings = new BaconiteArmor(6002, BACONITEA, proxy.addArmor("Baconite"), 2).setUnlocalizedName("BaconiteLeggings");
LanguageRegistry.addName(baconiteLeggings, "Baconite Leggings");

baconiteBoots = new BaconiteArmor(6003, BACONITEA, proxy.addArmor("Baconite"), 3).setUnlocalizedName("BaconiteBoots");
LanguageRegistry.addName(baconiteBoots, "Baconite Boots");


}
}

 

BaconiteArmor Class:

package mods.crystalia.common;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;

public class BaconiteArmor extends ItemArmor implements IArmorTextureProvider{

public BaconiteArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,
		int par3, int par4) {
	super(par1, par2EnumArmorMaterial, par3, par4);
	// TODO Auto-generated constructor stub
}

@Override
public String getArmorTextureFile(ItemStack itemstack) {
	if(itemstack.itemID == Crystalia.baconiteHelmet.itemID || itemstack.itemID == Crystalia.baconiteChestplate.itemID || itemstack.itemID == Crystalia.baconiteBoots.itemID){
		return "/mods/crystalia/textures/armor/baconite_1.png";


}

	if(itemstack.itemID == Crystalia.baconiteLeggings.itemID){
		return "/mods/crystalia/textures/armor/baconite_2.png";

}
	else return null;
}

@Override
    public void updateIcons(IconRegister iconRegister)
    {
        if(this == Crystalia.baconiteHelmet)     
	this.iconIndex = iconRegister.registerIcon("crystalia:helmetBaconite");
    
    
        {
 if(this == Crystalia.baconiteChestplate)     
		this.iconIndex = iconRegister.registerIcon("crystalia:chestplateBaconite");


}
        {
if(this == Crystalia.baconiteLeggings)     
this.iconIndex = iconRegister.registerIcon("crystalia:leggingsBaconite");
        }
        {
        	 if(this == Crystalia.baconiteBoots)     
        			this.iconIndex = iconRegister.registerIcon("crystalia:bootsBaconite");	
        }
}
}

 

Baconite Axe(I did the same code for evey tool using the appropriate extends):

package mods.crystalia.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemAxe;


public class AxeBaconite extends ItemAxe {

public AxeBaconite(int par1, EnumToolMaterial par2EnumToolMaterial) {
	super(par1, par2EnumToolMaterial);
	// TODO Auto-generated constructor stub
}

}

 

If you want to see anything else, please ask! I'm really desperate to get the crafting recipes working!

 

[glow=red,2,300]Please Help!![/glow]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.