Jump to content

Texture location in the filesystem


TreetopFlyer

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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");

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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