Jump to content

Recommended Posts

Posted

Hey guys. I've met a serious problem for me here. Well, i've created a 3d model of pistol. So its kinda item, but 3d rendered. It works fine, so its 3d rendered, but i dont know how to put textures on it. I tried out that code in my ItemRenderPistol file:

Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation ("testmod", "textures/models/blasterModelTexture.png"));

 

It wants me to create a ResourceLocation class! I can create one, but what i have to type inside of that class, to make my textures appear on my 3D item? Can you help me, i really need this. Please give examples of code of your ResourceLocation if you can.

Posted

if you are on 1.6.4 you can use:

 

ResourceLocation textures = (new ResourceLocation("name_modname:textures/items/texture.png")); 
Minecraft.getMinecraft().renderEngine.bindTexture(textures);

 

in your renderer. I think thats what you're after...

Posted

if you are on 1.6.4 you can use:

 

ResourceLocation textures = (new ResourceLocation("name_modname:textures/items/texture.png")); 
Minecraft.getMinecraft().renderEngine.bindTexture(textures);

 

in your renderer. I think thats what you're after...

 

bindTexture is not working ofcourse. It says that i have to change method bindTexture(String) to bindTexture(ResourceLocation) Also i use 1.5.2 ver

Posted

if you are on 1.6.4 you can use:

 

ResourceLocation textures = (new ResourceLocation("name_modname:textures/items/texture.png")); 
Minecraft.getMinecraft().renderEngine.bindTexture(textures);

 

in your renderer. I think thats what you're after...

 

You also havent answered on another part of my question. Am i suppose to create ResourceLocation file, and if i suppose, what i have to type in ResourceLocation file?

Posted

I have the exact code i put above running right now, in an entity renderer calling a model class, renderTileEntityAt method:

 

GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
ResourceLocation textures = (new ResourceLocation("skullywag_spawnCrystalsProto:textures/blocks/Crystal.png")); 
Minecraft.getMinecraft().renderEngine.bindTexture(textures);

GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

GL11.glPopMatrix();

 

It works fine, no class for the resource location.

Posted

I have the exact code i put above running right now, in an entity renderer calling a model class, renderTileEntityAt method:

 

GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
ResourceLocation textures = (new ResourceLocation("skullywag_spawnCrystalsProto:textures/blocks/Crystal.png")); 
Minecraft.getMinecraft().renderEngine.bindTexture(textures);

GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

GL11.glPopMatrix();

 

It works fine, no class for the resource location.

 

image.jpg

Posted

Hi

 

ResourceLocation is in package net.minecraft.util;

 

I also tried to find other ResourceLocation files, there is no such file. Althrought i'm using minecraft 1.5.2.

 

no idea why you can't import it.

 

-TGG

 

The import net.minecraft.util.ResourceLocation cannot be resolved

 

Dont really know what to do.. :(

Posted
Where there ResourceLocations in Minecraft 1.5.2? I'm getting confused with all the updates...

ResourceLocation was introduced in 1.6.

I knew it!!!

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.