Minecraftforge: [1.13.2] Texture map no longer allows adding new atlas sprites

Created on 22 Feb 2019  路  7Comments  路  Source: MinecraftForge/MinecraftForge

The TextureStitchEvents have getMap() which returns a TextureMap. In 1.12 you could call setTextureEntry to register TextureAtlasSprites, but this method no longer exists.

In 1.13, it's possible to register NativeImages with the TextureManager, which is fine for regular TESRs, but I'm fairly certain those can't be used with fast TESRs since you need to actually bind them.

1.13 Needs Update Regression Stale

Most helpful comment

Still needs a replacement for 1.14.

All 7 comments

Why can't you use registerSprite ?

I'm generating composite textures using palettes defined in datapacks. Whereas registerSprite only allows passing in an extra ResourceLocation to read from disk, setTextureEntry allowed registering custom TextureAtlasSprite instances in code.

This looks a little problematic for me too.

I'm working on a 1.12.2 mod for autogeneration of textures by json looking to be used by a few mods on the fly. I can't generate these textures outside the game as the mod is designed to be adaptable to resourcepack changes. TConstruct also has texture autogeneration. I'm looking to doing this in 1.13.2 as well.

Through my ongoing investigations, Minecraft is appearingly a little more direct with GL management.

It seems instead of having a TextureMap store all of the TextureAtlasSprite which stores all of the images by a list of double-int arrays and then uploading animation updates from those double-int array lists, it's directly managing the texture atlas using NativeImages as references to textures on the GL's stored texture atlas. I'm most likely wrong but this is my current impression on the situation thus far.

Hypothetically I'm seeing a way that allows a better way for me to auto-generate textures (using a FrameBuffer), but I'm not sure about stitching it in. I'm guessing I can use Stitcher to pull it into the TextureMap? I'll need to try it out when I get to porting to 1.13.

You're more or less right about NativeImage/TextureAtlasSprite. A NativeImage wraps a GL texture handle, and a TextureAtlasSprite wraps one or more NativeImages that sit in the stitched texture atlas.

Unfortunately Stitcher is a dead end. The Stitcher instance only exists in TextureMap's stitch method, and stitches together the TextureAtlasSprites that are already registered with the map.

Still needs a replacement for 1.14.

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

Was this page helpful?
0 / 5 - 0 ratings