Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • Author

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?

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

  • Author

"You probably imported the wrong class for Entity."

 

^ there you have it...

 

Thnx for pointing out my incredibly stupid mistake, Sensei!

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.