Jump to content

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


SR2610

Recommended Posts

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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