Jump to content

Recommended Posts

Posted

Got my armor working and also the texture as item.

My only problem is that I can't get it to render like I want.

Right now it just renders as Iron armor.

 

ArmorClass:

 

 

package Lord_of_Block.armor;

 

import net.minecraft.entity.Entity;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.util.EnumHelper;

import cpw.mods.fml.common.registry.GameRegistry;

 

public class Armor {

 

public static NividiumChestplate chestplate;

public static ArmorMaterial Nividium = EnumHelper.addArmorMaterial("Nividium", 2000 ,new int[]{50,30} , 30);

 

public static void addArmor(){

chestplate = new NividiumChestplate(Armor.Nividium, 2, 1, "nividium");

GameRegistry.registerItem(chestplate, "Nividium Chestplate");

}

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)

{

return "nividium:textures/armor/nividium_1.png";

}

}

 

 

 

  • 2 weeks later...
Posted

I have similar problem - helmet renders on model as Iron.

I see this http://www.minecraftforge.net/forum/index.php/topic,16186.0.html

But it not work for me.

[spoiler=Main]

@Mod(modid=mod_MicroUkr.MODID, name=mod_MicroUkr.NAME, version=mod_MicroUkr.VERSION)

public class mod_MicroUkr 
{
public static final String MODID = "microukr";
public static final String NAME = "MicroUkr";
public static final String VERSION = "0.1F";

public static ArmorMaterial UKR = EnumHelper.addArmorMaterial("ukr", 1000, new int[] {2, 6, 4, 2}, 9);
public static ItemArmor helmetUkr;
...
public void preInit(FMLPreInitializationEvent event)
{
helmetUkr = (ItemArmor) new HelmetUkr(mod_MicroUkr.UKR, 0, 0);
GameRegistry.registerItem(helmetUkr, helmetUkr.getUnlocalizedName().substring(5)); 
GameRegistry.addRecipe(new ItemStack(helmetUkr, 1), new Object[] {"###", "# #", '#', new ItemStack(blockUkrainium)});

}
...

 

 

[spoiler=HelmetUkr]

public class HelmetUkr extends ItemArmor 
{

public HelmetUkr(ArmorMaterial par1, int par2, int par3) 
{
	super(par1, par2, par3);
	this.setCreativeTab(mod_MicroUkr.tabMicroUkr);
	this.setUnlocalizedName("helmetUkr");
}

@SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister par1IconRegister)
    {
        this.itemIcon = par1IconRegister.registerIcon(mod_MicroUkr.MODID + ":helmetUkr");
    }

@SideOnly(Side.CLIENT)
public String getArmorTexture (ItemStack itemstack, Entity entity, int slot, String type)
    {
        return "mod_MicroUkr:textures/models/armor/ukr_1.png";


    }

 

 

Path to png file "D:\MCModdingForge\src\main\resources\assets\microukr\textures\models\armor"

 

/sorry for my english/

Posted

Sorry, I find one error in my import code part:

instead "import net.minecraft.entity.Entity" Eclipse insert "import com.sun.xml.internal.stream.Entity"

But now I have next: ()

97c57cc6e19c.jpg

62cca30d4e06.jpg

Black cube :-/.

I try to use image from other mod but result the same.

 

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.