Jump to content

[1.19] Convert NativeImage to texture for item


ZachT112

Recommended Posts

So this is kind of odd, but I'm trying to make a mod a 256x256 image is downloaded and set to the texture of an item. It doesn't need to be updated during the game, but on launch.

I have it downloading the image and putting it in the game directory (a PNG) and then importing it into the game as a NativeImage, but I'm having trouble getting from the NativeImage to the texture on the item itself.

Edited by ZachT112
Link to comment
Share on other sites

  • ZachT112 changed the title to [1.19] Convert NativeImage to texture for item

I'm trying to get the texture stitched into the block atlas. I feel like it should be relatively simple but I've been trying to use the TextureStitchEvent.Pre to somehow figure out how to register the sprite to be stitched into the atlas, but the only method is addSprite, which tells the atlas that there is a model file somewhere, it doesn't take a texture.

Link to comment
Share on other sites

7 hours ago, Luis_ST said:

The method #addSprite requies a ResourceLocation, and the ResourceLocation should contains your mod id (namspace) and the path to the texture.

I've tried #addSprite, but that tries to pull a png file from the assets folder. I have a native image that I am trying to use, not a file within the assets folder. The texture is generated at runtime, and therefore is not in the assets folder.

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.