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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • https://pastebin.com/VwpAW6PX My game crashes upon launch when trying to implement the Oculus mod to this mod compilation, above is the crash report, I do not know where to begin to attempt to fix this issue and require assistance.
    • https://youtube.com/shorts/gqLTSMymgUg?si=5QOeSvA4TTs-bL46
    • CubeHaven is a SMP server with unique features that can't be found on the majority of other servers! Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132 3 different stores: - CubeHaven Store: Our store to purchase using real money. - Bitcoin Store: Store for Bitcoin. Bitcoin can be earned from playing the server. Giving options for players if they want to spend real money or grind to obtain exclusive packages. - Black Market: A hidden store for trading that operates outside our traditional stores, like custom enchantments, exclusive items and more. Some of our features include: Rank Up: Progress through different ranks to unlock new privileges and perks. 📈 Skills: RPG-style skill system that enhances your gaming experience! 🎮 Leaderboards: Compete and shine! Top players are rewarded weekly! 🏆 Random Teleporter: Travel instantly across different worlds with a click! 🌐 Custom World Generation: Beautifully generated world. 🌍 Dungeons: Explore challenging and rewarding dungeons filled with treasures and monsters. 🏰 Kits: Unlock ranks and gain access to various kits. 🛠️ Fishing Tournament: Compete in a friendly fishing tournament! 🎣 Chat Games: Enjoy games right within the chat! 🎲 Minions: Get some help from your loyal minions. 👥 Piñata Party: Enjoy a festive party with Piñatas! 🎉 Quests: Over 1000 quests that you can complete! 📜 Bounty Hunter: Set a bounty on a player's head. 💰 Tags: Displayed on nametags, in the tab list, and in chat. 🏷️ Coinflip: Bet with other players on coin toss outcomes, victory, or defeat! 🟢 Invisible & Glowing Frames: Hide your frames for a cleaner look or apply a glow to it for a beautiful look. 🔲✨[ Player Warp: Set your own warp points for other players to teleport to. 🌟 Display Shop: Create your own shop and sell to other players! 🛒 Item Skins: Customize your items with unique skins. 🎨 Pets: Your cute loyal companion to follow you wherever you go! 🐾 Cosmetics: Enhance the look of your character with beautiful cosmetics! 💄 XP-Bottle: Store your exp safely in a bottle for later use! 🍶 Chest & Inventory Sorting: Keep your items neatly sorted in your inventory or chest! 📦 Glowing: Stand out from other players with a colorful glow! ✨ Player Particles: Over 100 unique particle effects to show off. 🎇 Portable Inventories: Over virtual inventories with ease. 🧳 And a lot more! Become part of our growing community today! Discord: https://cubehaven.net/discord Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132
    • # Problematic frame: # C [libopenal.so+0x9fb4d] It is always the same issue - this refers to the Linux OS - so your system may prevent Java from working   I am not familiar with Linux - check for similar/related issues  
  • Topics

×
×
  • Create New...

Important Information

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