Jump to content

[1.5.2]ResourceLocation


DoorCloser

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.. :(

Link to comment
Share on other sites

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

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/

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

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