Jump to content

[1.9] Armors are not loaded from mod folder


JimiIT92

Recommended Posts

When trying to equip custom armor it gives me this error

java.io.FileNotFoundException: minecraft:textures/models/armor/ruby_armor_layer_2.png
at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:68) ~[FallbackResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:64) ~[simpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:34) ~[simpleTexture.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:67) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:42) [TextureManager.class:?]
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:127) [Render.class:?]
at net.minecraft.client.renderer.entity.layers.LayerArmorBase.renderArmorLayer(LayerArmorBase.java:65) [LayerArmorBase.class:?]
at net.minecraft.client.renderer.entity.layers.LayerArmorBase.doRenderLayer(LayerArmorBase.java:39) [LayerArmorBase.class:?]
at net.minecraft.client.renderer.entity.RenderLivingBase.renderLayers(RenderLivingBase.java:456) [RenderLivingBase.class:?]
at net.minecraft.client.renderer.entity.RenderLivingBase.doRender(RenderLivingBase.java:196) [RenderLivingBase.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:74) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:28) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:365) [RenderManager.class:?]
at net.minecraft.client.gui.inventory.GuiInventory.drawEntityOnScreen(GuiInventory.java:141) [GuiInventory.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:814) [GuiContainerCreative.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:98) [GuiContainer.class:?]
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:62) [inventoryEffectRenderer.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:652) [GuiContainerCreative.class:?]
at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:309) [ForgeHooksClient.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1147) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1135) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:401) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]

and of course a black/purple texture

 

This is my armor class, is this a bug or there's something wrong?

package com.mineworld.items;

import com.mineworld.MW;
import com.mineworld.core.MWItems;
import com.mineworld.core.MWTabs;

import net.minecraft.entity.Entity;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemArmorMW extends ItemArmor {

private String material;
public ItemArmorMW(ArmorMaterial par1, EntityEquipmentSlot par3) {
	super(par1, 0, par3);
	this.setCreativeTab(MWTabs.tabCombat);
	this.material = par1.name().toLowerCase();
}

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
	if(slot == 2)
		return MW.MODID + ":" + "textures/models/armor/" + this.material + "_layer_2.png";
	else
		return MW.MODID + ":" + "textures/models/armor/" + this.material + "_layer_1.png";
}


@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
	if(this.material.equals("ruby_armor") && repair.getItem().equals(MWItems.ruby) ||
	   this.material.equals("sapphire_armor") && repair.getItem().equals(MWItems.sapphire) ||
	   this.material.equals("copper_armor") && repair.getItem().equals(MWItems.copper_ingot) ||
	   this.material.equals("bronze_armor") && repair.getItem().equals(MWItems.copper_ingot) ||
	   this.material.equals("silver_armor") && repair.getItem().equals(MWItems.copper_ingot) ||
	   this.material.equals("aluminium_armor") && repair.getItem().equals(MWItems.copper_ingot))
		return true;
	else
		return false;
}
}

Don't blame me if i always ask for your help. I just want to learn to be better :)

Link to comment
Share on other sites

Item#getArmorTexture

changed signature in 1.9 (

int slot

became

EntityEquipmentSlot slot

), you'd already know this if you'd used the

@Override

annotation.

 

If you give your

ArmorMaterial

a name that includes your resource domain (e.g.

mineworld:ruby_armor

), you don't need to override

Item#getArmorTexture

at all.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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



×
×
  • Create New...

Important Information

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