Jump to content

[1.7.10] "Failed to load texture" Armor Model/Render


Arekkuusu

Recommended Posts

Hello all, I made an Armor that renders as a Model, its all aiite, except that its too big (Cant GL11 scale it??)... and the texture cant be found because it keeps trying to load a "vanilla texture":  :'(

 

[17:26:32] [Client thread/WARN]: Failed to load texture: minecraft:textures/models/armor/KokorosMasks_layer_1.png

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

at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[simpleTexture.class:?]

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]

at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?]

at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:60) [Render.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) [RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) [RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]

at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]

at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) [EntityRenderer.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]

at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]

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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

 

As you can see, I dont have a texture inside THAT folder

 

Here is the first code for it (the payer is missing the body texture):

 

public class ItemKokorosMasks extends ItemArmor {

 

        private static final ModelBiped var10 = new ModelKokorosMasks();

 

public ItemKokorosMasks(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

}

 

@SideOnly(Side.CLIENT)

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

if(stack.getItem() == GOAItem.itemKokorosMasks){

return LibMod.MODID + "textures/models/KokorosMasks_layer_1.png";

} else {

return null;

}

}

 

@SideOnly(Side.CLIENT)

public ModelBiped getArmorModel(int id){

return var10;

}

 

@SideOnly(Side.CLIENT)

ModelBiped armorModel = new ModelBiped();

public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {

 

if(itemStack != null){

if(itemStack.getItem() instanceof ItemKokorosMasks){

int type = ((ItemArmor)itemStack.getItem()).armorType;

 

if(type == 1 || type == 1){

armorModel = getArmorModel(1);

} else {

armorModel = getArmorModel(1);

}

}

if(armorModel != null){

armorModel.bipedHead.showModel = armorSlot == 3;

armorModel.bipedHeadwear.showModel = armorSlot == 3;

armorModel.bipedBody.showModel = armorSlot == 0;

armorModel.bipedRightArm.showModel = armorSlot == 3;

armorModel.bipedLeftArm.showModel = armorSlot == 3;

armorModel.bipedRightLeg.showModel = armorSlot == 3;

armorModel.bipedLeftLeg.showModel = armorSlot == 3;

armorModel.isSneak = entityLiving.isSneaking();

armorModel.isRiding = entityLiving.isRiding();

armorModel.isChild = entityLiving.isChild();

armorModel.heldItemRight = entityLiving.getEquipmentInSlot(0) != null ? 1 :0;

return armorModel;

}

}

return null;

}

 

@SideOnly(Side.CLIENT)

public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {

p_77624_3_.add(EnumChatFormatting.DARK_AQUA

+ "Tsukumogami of Emotions");

p_77624_3_.add(EnumChatFormatting.GOLD

+ "Feel the power of 66 masks");

p_77624_3_.add(EnumChatFormatting.GOLD

+ "being worn at the same time");

}

 

@Override

@SideOnly(Side.CLIENT)

public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {

super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);{

EntityPlayer player = (EntityPlayer) p_77663_3_;

if (!p_77663_2_.isRemote && p_77663_3_ instanceof EntityPlayer) {

ItemStack[] inventory = player.inventory.mainInventory;

for (int i = 0; i < inventory.length; i++) {

if (inventory != null && inventory.getItem() == this && i != p_77663_4_) {

player.dropPlayerItemWithRandomChoice(inventory, true);

inventory = null;

}

}

}

}

}

 

@Override

@SideOnly(Side.CLIENT)

public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {

if(player.experienceLevel <= 70){

player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.resistance.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.jump.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 0, 4));

player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 25, 4));

}

}

 

@SideOnly(Side.CLIENT)

public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {

 

}

 

@Override

@SideOnly(Side.CLIENT)

public EnumRarity getRarity(ItemStack par1ItemStack) {

return EnumRarity.epic;

}

}

 

 

Second try(Now the whole player is missing the texture...):

 

public class ItemKokorosMasks extends ItemArmor implements ISpecialArmor{

 

protected ModelBiped[] models = null;

public int type;

static IIcon willIcon;

 

public ItemKokorosMasks(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

}

 

@Override

public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {

return new ArmorProperties(0, damageReduceAmount / 25D, armor.getMaxDamage() + 1 - armor.getItemDamage());

}

 

@Override

public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {

return damageReduceAmount;

}

 

@Override

public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {

 

}

 

@SideOnly(Side.CLIENT)

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

if(stack.getItem() == GOAItem.itemKokorosMasks){

return LibMod.MODID + "textures/models/KokorosMasks_layer_1.png";

} else {

return null;

}

}

 

@SideOnly(Side.CLIENT)

public static void renderOnPlayer(ItemStack stack, RenderPlayerEvent event) {

GL11.glPushMatrix();

float f = willIcon.getMinU();

float f1 = willIcon.getMaxU();

float f2 = willIcon.getMinV();

float f3 = willIcon.getMaxV();

Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);

GL11.glRotatef(90F, 0F, 1F, 0F);

GL11.glRotatef(180F, 1F, 0F, 0F);

GL11.glTranslatef(-0.26F, 0.15F, -0.39F);

GL11.glScalef(0.5F, 0.5F, 0.5F);

ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, willIcon.getIconWidth(), willIcon.getIconHeight(), 1F / 16F);

GL11.glPopMatrix();

}

 

@Override

@SideOnly(Side.CLIENT)

public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {

ModelBiped model = getArmorModelForSlot(entityLiving, itemStack, armorSlot);

if(model == null)

model = provideArmorModelForSlot(itemStack, armorSlot);

 

if(model != null)

return model;

 

return super.getArmorModel(entityLiving, itemStack, armorSlot);

}

 

@SideOnly(Side.CLIENT)

public ModelBiped getArmorModelForSlot(EntityLivingBase entity, ItemStack stack, int slot) {

if(models == null)

models = new ModelBiped[4];

 

return models[slot];

}

 

@SideOnly(Side.CLIENT)

public ModelBiped provideArmorModelForSlot(ItemStack stack, int slot) {

models[slot] = new ModelKokorosMasks();

return models[slot];

}

}

 

 

Thanks for reading I guess *gives sweet potato*

Aya Shamelessmaru at your service

Link to comment
Share on other sites

You need a colon between the modid and the resource path.

Doesnt work, it tries to load the texture from minecraft:textures/models/armor/KokorosMasks_layer_1.png....

NvMFtrF.png

FVsI0uS.png

I fixed it, it turns out the Item class has its own getArmorTexture:

/**
     * Called by RenderBiped and RenderPlayer to determine the armor texture that
     * should be use for the currently equiped item.
     * This will only be called on instances of ItemArmor.
     *
     * Returning null from this function will use the default value.
     *
     * @param stack ItemStack for the equpt armor
     * @param entity The entity wearing the armor
     * @param slot The slot the armor is in
     * @param type The subtype, can be null or "overlay"
     * @return Path of texture to bind, or null to use default
     */
    public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
    {
        return null;
    }

I just had to make it return my texture location and it got fixed :D

 

Aya Shamelessmaru at your service

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.

Announcements



×
×
  • Create New...

Important Information

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