Jump to content

Recommended Posts

Posted

Greetings,

 

I've been trying to get armor textures working, but minecraft gives the following error:

 

 

[Client thread/WARN]: Failed to load texture: minecraft:textures/models/armor/testArmor_layer_2.png

java.io.FileNotFoundException: minecraft:textures/models/armor/testArmor_layer_2.png

 

 

Now testarmor can be found in MODID:textures/models/armor/ , thus minecraft is searching at the wrong place while I do think

I've pointed him to the correct folder...

 

The TestArmor Class: (mistake is most likely here)

 

public class testArmor extends ItemArmor {

 

public testArmor(ArmorMaterial p_i45325_1_, int id, int placement) {

super(p_i45325_1_, id, placement);

 

if(placement==0){ //if armor is helmet

this.setTextureName(Strings.MODID + ":testHelmet");

}

else if(placement==1){ //if armor is chest

this.setTextureName(Strings.MODID + ":testChestplate");

}

else if(placement==2){ //if armor is leggings

this.setTextureName(Strings.MODID + ":testLeggings");

}

else if(placement==3){ //if armor is boots

this.setTextureName(Strings.MODID + ":testBoots");

}

}

 

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

if(stack.getItem() == RGAitem.testBoots || stack.getItem() == RGAitem.testPlate || stack.getItem() == RGAitem.testHelmet){

return Strings.MODID + ":textures/models/armor/testArmor_layer_1.png";

}else if(stack.getItem() == RGAitem.testPants){

return Strings.MODID + ":textures/models/armor/testArmor_layer_2.png";

}else{

return null;

}

}

 

 

My Item Registry:

 

public class RGAitem {

 

public static void mainRegistry(){

initialiseItem();

registerItem();

}

 

public static Item testPlate;

public static Item testBoots;

public static Item testHelmet;

public static Item testPants;

 

public static void initialiseItem(){

testPlate = new testArmor(ArmorMaterial.DIAMOND,MainRegistry.proxy.addArmor("testArmor"),1).setUnlocalizedName("testPlate").setCreativeTab(CreativeTabs.tabMisc);

testBoots = new testArmor(ArmorMaterial.DIAMOND,MainRegistry.proxy.addArmor("testArmor"),3).setUnlocalizedName("testBoots").setCreativeTab(CreativeTabs.tabMisc);

testHelmet = new testArmor(ArmorMaterial.DIAMOND,MainRegistry.proxy.addArmor("testArmor"),0).setUnlocalizedName("testHelmet").setCreativeTab(CreativeTabs.tabMisc);

testPants = new testArmor(ArmorMaterial.DIAMOND,MainRegistry.proxy.addArmor("testArmor"),2).setUnlocalizedName("testPants").setCreativeTab(CreativeTabs.tabMisc);

}

 

public static void registerItem(){

GameRegistry.registerItem(testPlate, testPlate.getUnlocalizedName());

GameRegistry.registerItem(testBoots, testBoots.getUnlocalizedName());

GameRegistry.registerItem(testHelmet, testHelmet.getUnlocalizedName());

GameRegistry.registerItem(testPants, testPants.getUnlocalizedName());

}

 

}

 

 

What horribly stupid mistake have I made here? Why doesn't Mr. forge search in the correct folder?

 

Thanks in advance,

 

Resk

Posted

Before anybody starts saying that I should use Override: Eclipse doesn't want to accept the override:

 

 

The method getArmorTexture(ItemStack, Entity, int, String) of type testArmor must override or implement a supertype method

 

 

I know that this is strange as Item HAS the getArmorTexture() function so why does Override not work?

Posted

Because you arnt overriding the right function -.-

You have to match the name AND the arguments.

You probably imported the wrong class for Entity.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.