Jump to content

[Solved] [1.6.2] Custom Item Model - Can't Find Texture


Recommended Posts

Posted

I am trying to create a custom sword model for a future mod, I manage to get the sword model to load in, and it is positioned correctly, but I can't get the texture to assign to it.  I always get this error:

 

2013-07-26 21:29:32 [WARNING] [Minecraft-Client] Failed to load texture: minecraft:/assets/tutorial/textures/model/dagger.png
java.io.FileNotFoundException: minecraft:/assets/tutorial/textures/model/dagger.png
at net.minecraft.client.resources.FallbackResourceManager.func_110536_a(FallbackResourceManager.java:64)
at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110536_a(SimpleReloadableResourceManager.java:63)
at net.minecraft.client.renderer.texture.SimpleTexture.func_110551_a(SimpleTexture.java:31)
at net.minecraft.client.renderer.texture.TextureManager.func_110579_a(TextureManager.java:84)
at net.minecraft.client.renderer.texture.TextureManager.func_110577_a(TextureManager.java:41)
at modding.tutorial.ItemRenderSword.renderItem(ItemRenderSword.java:47)
at net.minecraftforge.client.ForgeHooksClient.renderEquippedItem(ForgeHooksClient.java:201)
at net.minecraft.client.renderer.ItemRenderer.renderItem(ItemRenderer.java:89)
at net.minecraft.client.renderer.ItemRenderer.renderItemInFirstPerson(ItemRenderer.java:490)
at net.minecraft.client.renderer.EntityRenderer.renderHand(EntityRenderer.java:712)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1292)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:934)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)

 

 

If you want to see the item renderer code here it is:

package modding.tutorial;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderSword implements IItemRenderer {

protected dagger SwordModel;

public ItemRenderSword() {
	SwordModel = new dagger();
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	switch (type) {
	case EQUIPPED:
		return true;
	case EQUIPPED_FIRST_PERSON:
		return true;
	default:
		return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
		ItemRendererHelper helper) {

	return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

	switch (type) {
	case EQUIPPED:
	case EQUIPPED_FIRST_PERSON: {

		GL11.glPushMatrix();
		Minecraft.getMinecraft().renderEngine
		.func_110577_a(new ResourceLocation(
				"/assets/tutorial/textures/model/dagger.png"));  //NEED TO FIX THIS

		float scale = 1.4F;
		GL11.glScalef(scale, scale, scale);
		GL11.glRotatef(90, -1, 0, 0);
		GL11.glRotatef(85, 0, 0, 1);
		GL11.glRotatef(180, 0, 1, 0);
		GL11.glRotatef(135, 1, 0, 0);
		GL11.glTranslatef(-0.1F, -0.5F, 0.5F); // Left-Right
		// Forward-Backwards Up-Down
		SwordModel.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F,
				0.0625F);

		GL11.glPopMatrix();
	}
	default:
		break;
	}
}
}

 

 

If you could help me at all, it would be useful.

SR2610 | Nemesis

Minecraft Modder | Planet Minecraft Moderator

Posted

i dont know why you want a model for an item but change your path to this

 

"tutorial","/textures/model/dagger.png"

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Posted

Thanks, that got it working for me.  The reason I am doing this is so I can have a base that I can adapt further 3d modeled weapons from in the future

SR2610 | Nemesis

Minecraft Modder | Planet Minecraft Moderator

Posted

o ok :)

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello , when I try to launch the forge installer it just crash with a message for 0,5 secondes. I'm using java 17 to launch it. Here's the link of the error :https://cdn.corenexis.com/view/?img=d/ma24/qs7u4U.jpg  
    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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