Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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

  • Author

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

  • Author

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?

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.

  • Author

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

  • Author

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

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/

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.