Jump to content

[SOLVED][1.6.2] Armor Render Issue? or Code?


SuperHB
 Share

Recommended Posts

Hey guys SuperHB here! :) I am working on my mod MobDrops right now and I was working on the Armor and when I try it on it gives me an error. I'm not sure if my code is bad or because there is something wrong with Forge right now. here is the error and the code i used:

 

Error

2013-07-15 14:32:39 [WARNING] [Minecraft-Client] Failed to load texture: minecraft:/assests/minecraft/textures/armor/wolf_1
java.io.FileNotFoundException: minecraft:/assests/minecraft/textures/armor/wolf_1
at net.minecraft.client.resources.FallbackResourceManager.func_110536_a(FallbackResourceManager.java:64)
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110536_a(SimpleReloadableResourceManager.java:63)
at net.minecraft.client.renderer.texture.SimpleTexture.func_110551_a(SimpleTexture.java:31)
at net.minecraft.client.renderer.texture.TextureManager.func_110579_a(TextureManager.java:84)
at net.minecraft.client.renderer.texture.TextureManager.func_110577_a(TextureManager.java:41)
at net.minecraft.client.renderer.entity.Render.func_110776_a(Render.java:50)
at net.minecraft.client.renderer.entity.RenderPlayer.setArmorModel(RenderPlayer.java:72)
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:519)
at net.minecraft.client.renderer.entity.RendererLivingEntity.func_130000_a(RendererLivingEntity.java:162)
at net.minecraft.client.renderer.entity.RenderPlayer.func_130009_a(RenderPlayer.java:170)
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:558)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:313)
at net.minecraft.client.gui.inventory.GuiInventory.func_110423_a(GuiInventory.java:121)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:849)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:111)
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:43)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:674)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1037)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:933)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-15 14:32:41 [WARNING] [Minecraft-Client] Failed to load texture: minecraft:assets/minecraft/textures/armor/creeper_1
java.io.FileNotFoundException: minecraft:assets/minecraft/textures/armor/creeper_1
at net.minecraft.client.resources.FallbackResourceManager.func_110536_a(FallbackResourceManager.java:64)
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110536_a(SimpleReloadableResourceManager.java:63)
at net.minecraft.client.renderer.texture.SimpleTexture.func_110551_a(SimpleTexture.java:31)
at net.minecraft.client.renderer.texture.TextureManager.func_110579_a(TextureManager.java:84)
at net.minecraft.client.renderer.texture.TextureManager.func_110577_a(TextureManager.java:41)
at net.minecraft.client.renderer.entity.Render.func_110776_a(Render.java:50)
at net.minecraft.client.renderer.entity.RenderPlayer.setArmorModel(RenderPlayer.java:72)
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:519)
at net.minecraft.client.renderer.entity.RendererLivingEntity.func_130000_a(RendererLivingEntity.java:162)
at net.minecraft.client.renderer.entity.RenderPlayer.func_130009_a(RenderPlayer.java:170)
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:558)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:313)
at net.minecraft.client.gui.inventory.GuiInventory.func_110423_a(GuiInventory.java:121)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:849)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:111)
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:43)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:674)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1037)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:933)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

 

Code

package net.MobDrops.superhb.mod.armor;

import net.MobDrops.superhb.mod.MobDropsAll;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ArmorTest extends ItemArmor
{
    public String armorNamePrefix;
    public EnumArmorMaterial material;

    public ArmorTest(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String armornamePrefix)
    {
        super(par1, par2EnumArmorMaterial, par3, par4);
        this.material = par2EnumArmorMaterial;
        par2EnumArmorMaterial.getDamageReductionAmount(par4);
        this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4));
        this.maxStackSize = 1;
        this.setCreativeTab(MobDropsAll.tabMobDropsArmor);
        armorNamePrefix = armornamePrefix;
    }

    public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
    {
        if (stack.toString().contains("leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        if (stack.toString().contains("Leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        return "/assests/minecraft/textures/armor/wolf_1";
    }
}

 

Second Code Link:

http://gw.minecraftforge.net/NHLo

 

If you know the code please give it to me and i'll put you in the credits of MobDrops!

 

Thanks,

    SuperHB

Link to comment
Share on other sites

3 problems with this with your return "armour path"

 

You need to use this format return "modID:textures/models/armor/armorName_layer_(1 or 2).png"

 

So that would be something like return "lmp:textures/models/armor/titanium_layer_1.png"

Link to comment
Share on other sites

  • 2 weeks later...

It didnt work for me. I still got the beautiful black and purple armor textures. :/

 

Here is the Modified Code:

package net.MobDrops.superhb.mod.armor;

import net.MobDrops.superhb.mod.MobDropsAll;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class CreeperArmor extends ItemArmor
{
    public String armorNamePrefix;
    public EnumArmorMaterial material;

    public CreeperArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
    {
        super(par1, par2EnumArmorMaterial, par3, par4);
        this.material = par2EnumArmorMaterial;
        par2EnumArmorMaterial.getDamageReductionAmount(par4);
        this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4));
        this.maxStackSize = 1;
        this.setCreativeTab(MobDropsAll.tabMobDropsArmor);
    }

    public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
    {
        if (this.material == MobDropsAll.CreeperArmor)
        {
            if (stack.getItem().itemID == MobDropsAll.creeperarmorhelmet.itemID)
            {
                return "mobdrops:textures/armor/creeper_" + (this.armorType == 2 ? 2 : 1) + ".png";
            }
            else if (stack.getItem().itemID == MobDropsAll.creeperarmorchestplate.itemID || stack.getItem().itemID == MobDropsAll.creeperarmorboots.itemID)
            {
                return "mobdrops:textures/armor/creeper_" + (this.armorType == 2 ? 2 : 1) + ".png";
            }
            else if (stack.getItem().itemID == MobDropsAll.creeperarmorleggings.itemID)
            {
                return "mobdrops:textures/armor/creeper_" + (this.armorType == 2 ? 2 : 1) + ".png";
            }
        }

        return null;
    }
}

 

Link to comment
Share on other sites

You're sure your armour textures are in: mcp/src/assets/minecraft/mobdrops/textures/armor? Also all of those folders MUST be in lowercase!

That should be mcp/src/minecraft/assets/mobdrops/textures/armor, but close enough ;)

Oh haha didn't even notice I did that

Link to comment
Share on other sites

I would create a variable in the base class with my modid, like this:

public static final String modid = "[Your Modid]";

Then I would move the texture localasition from: "mcp/src/minecraft/assest/mobdrops/textures/armor" to "mcp/src/minecraft/assest/[Your Modid]/textures/armor"

now I would change this Method

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
    {
        if (stack.toString().contains("leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        if (stack.toString().contains("Leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        return "/assests/minecraft/textures/armor/wolf_1";
    }

to something like this Method:

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
        if(stack.itemID == [Your Base Class].[Your Helmet].itemID || stack.itemID == [Your Base Class].[Your Chestplate].itemID || stack.itemID == [Your Base Class].[Your Helmet].[Your Boots].itemID) {
        	return armorTexture+ "wolf_1.png";
        }
        
        if(stack.itemID == [Your Base Class].[Your Leggins].itemID) {
        	return armorTexture+ "wolf_2.png";
        }
}

and the variable "armorTexture" I would define so:

private final String armorTexture = [Your Base Class].modid + "textures/armor/";

 

I hope you can understand this.

 

Link to comment
Share on other sites

There is a much easier way just say if slotID is 2 then load layer 2. it works fine!

 

package minecraftwero.baconMod.common.items;

import java.util.Random;

import minecraftwero.baconMod.Bacon;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

/**
* 
* @author MinecraftWero, Speiger
*
*/
public class BaconArmor extends ItemArmor
{

public String par10;
public String par11;

public BaconArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String texture, String name)
{
	super(par1, par2EnumArmorMaterial, par3, par4);
	par10 = name;
	this.setMaxStackSize(1);
	par11 = texture;
	this.setCreativeTab(Bacon.baconMod);
	this.setNoRepair();
	this.func_111206_d(texture);
}



@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) 
{
	if(slot == 2)return "minecraftwero:textures/models/armor/bacon_layer_2.png";
	else return "minecraftwero:textures/models/armor/bacon_layer_1.png";
}


public String getItemDisplayName(ItemStack par1)
{
	return par10;
}


@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister par1IconRegister)
{
	this.itemIcon = par1IconRegister.registerIcon(par11);
}




}

Link to comment
Share on other sites

I would create a variable in the base class with my modid, like this:

public static final String modid = "[Your Modid]";

Then I would move the texture localasition from: "mcp/src/minecraft/assest/mobdrops/textures/armor" to "mcp/src/minecraft/assest/[Your Modid]/textures/armor"

now I would change this Method

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
    {
        if (stack.toString().contains("leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        if (stack.toString().contains("Leggings"))
        {
            return "/assests/minecraft/textures/armor/wolf_2";
        }

        return "/assests/minecraft/textures/armor/wolf_1";
    }

to something like this Method:

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
        if(stack.itemID == [Your Base Class].[Your Helmet].itemID || stack.itemID == [Your Base Class].[Your Chestplate].itemID || stack.itemID == [Your Base Class].[Your Helmet].[Your Boots].itemID) {
        	return armorTexture+ "wolf_1.png";
        }
        
        if(stack.itemID == [Your Base Class].[Your Leggins].itemID) {
        	return armorTexture+ "wolf_2.png";
        }
}

and the variable "armorTexture" I would define so:

private final String armorTexture = [Your Base Class].modid + "textures/armor/";

 

I hope you can understand this.

 

 

/\

|

That didn't work for me :/

 

There is a much easier way just say if slotID is 2 then load layer 2. it works fine!

 

package minecraftwero.baconMod.common.items;

import java.util.Random;

import minecraftwero.baconMod.Bacon;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

/**
* 
* @author MinecraftWero, Speiger
*
*/
public class BaconArmor extends ItemArmor
{

public String par10;
public String par11;

public BaconArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String texture, String name)
{
	super(par1, par2EnumArmorMaterial, par3, par4);
	par10 = name;
	this.setMaxStackSize(1);
	par11 = texture;
	this.setCreativeTab(Bacon.baconMod);
	this.setNoRepair();
	this.func_111206_d(texture);
}



@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) 
{
	if(slot == 2)return "minecraftwero:textures/models/armor/bacon_layer_2.png";
	else return "minecraftwero:textures/models/armor/bacon_layer_1.png";
}


public String getItemDisplayName(ItemStack par1)
{
	return par10;
}


@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister par1IconRegister)
{
	this.itemIcon = par1IconRegister.registerIcon(par11);
}




}

 

/\

|

This one could work but i would like to know the code that you used in the base class?

EX:

public static Item creeperarmorhelmet = new CreeperArmor(5225, CreeperArmor, ModLoader.addArmor("Creeper"), 0).setCreativeTab(MobDropsAll.tabMobDropsArmor).setUnlocalizedName("CHelmet").func_111206_d("CHelmet");

Link to comment
Share on other sites

Yeah:

 

The item has to look like this:

 

public static Item creeperArmor = new BaconArmor(500, CreeperArmor, ModLoader.addArmor("Creeper"), 0, "modID:Texture", "Creeper Armor");

 

You do not need to add a creative tab.

The creative tab is inside of the class^^

Link to comment
Share on other sites

Yeah:

 

The item has to look like this:

 

public static Item creeperArmor = new BaconArmor(500, CreeperArmor, ModLoader.addArmor("Creeper"), 0, "modID:Texture", "Creeper Armor");

 

You do not need to add a creative tab.

The creative tab is inside of the class^^

 

Didn't work for me :( it makes the item in my hand black and purple as well...

Link to comment
Share on other sites

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
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.

 Share



×
×
  • Create New...

Important Information

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