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

Very noob question-- I can't figure out how to point the rendering engine to a texture in the filesystem.

As bindTexture is depreciated, apparently its now done like this with func_110577_a(?):

ResourceLocation rl = new ResourceLocation("path/to/rasterImage.png");

Minecraft.getMinecraft().renderEngine.func_110577_a(rl);

Anyway, where, in the filesystem, is the compiler(or is it the runtime?) looking for rasterImage.png?

 

When I run the above snippet with "textures/entity/arrow.png" as the argument

for the ResourceLocation constructor, (something I found in another class) it works, but I don't know why, or where it found that image, or how to supply my own image.

search for "hydroflame guide to texture" in the wiki

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

ERR wait a second, im following your guide very closely. At the very bottom it says:

ResourceLocation myImage = new ResourceLocation("genericmodid", "you/can/use/any/path/theImage.png");

 

So, I have in my code a static member of the class MyClass (implements IItemRenderer) as the resource like this:

private static ResourceLocation RL = new ResourceLocation("MyMod", "test.png");

 

And in the MyClass render routine I'm calling:

Minecraft.getMinecraft().renderEngine.func_110577_a(MyClass.RL);

 

and in the filesystem I have a png like this:

mcp/src/minecraft/assets/test.png

 

but  still get this runtime exception:

[WARNING] [Minecraft-Client] Failed to load texture: MyMod:test.png

src/minecraft/assets/*modid*/test.png

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

ok in the filesystem i added the extra folder (named after the modid) in the assets directory and moved the image in there like you indicated, but still no dice.

 

to re-cap, i have the filesystem setup like this:

mcp/src/minecraft/assets/MyMod/test.png

 

and the ResourceLocation code is unchanged:

private static ResourceLocation RL = new ResourceLocation("MyMod", "test.png");

caps are not allowed for mod ids

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

ok ok looks like that got rid of the exception! the item (this is for an item renderer) is invisible. test.png is a solid orange block, 32x32. if i change the path back to that factory arrow texture, i can see it show up on parts of the item. But this test texture, even though it is a solid color, never shows up. is 32x32 an illegal size?

  • Author

ok seems to be a techne model issue of some sort. i was able to pull the test.png texture in and render it on the arrow geometry i ganked from somewhere else. I'll see if I can't fix it from here. Thanks Hydroflame for all your help!

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.