[RFC] Remove ITextureAtlasSpriteLoader
in favor of SpriteSource
s
#157
Labels
breaking change
Breaks binary compatibility
rendering
Related to rendering
request for comments
For gathering opinions on some topic or subject
The
ITextureAtlasSpriteLoader
API was introduced in 1.16 by MinecraftForge/MinecraftForge#7822 to allow the creation of atlas-stitched textures with special behaviour outside of the capabilities of vanilla's texture animation system, such as proceduraly generated textures like shown in the linked PR.In 1.19.3, the
SpriteSource
system was introduced as part of the rework of texture loading. With this system, a JSON file is loaded for each registered atlas (in the case of multiple packs containing this JSON, the behaviour is comparable to tags in that the entries are merged) which contains an array of sources, each with a type field and any arbitrary metadata the respectiveSpriteSource
needs. ASpriteSource
can then queue an arbitrary amount ofSpriteSource.SpriteSupplier
s for loading, each associated with aResourceLocation
representing the final path of the texture created by the sprite supplier. Two sprite suppliers with the same result path will overwrite each other and the last one to be queued wins. The sprite supplier then producesSpriteContents
with the actual pixels of the texture. Since all relevant data of the texture (except absolute coordinates and UV coordinates on the atlas) and the creation of the sprite's ticker were moved fromTextureAtlasSprite
toSpriteContents
, theSpriteSource
API has basically the exact same capabilities asITextureAtlasSpriteLoader
. Additionally, theSpriteSource
API also has the benefit of being able to create textures from thin air while theITextureAtlasSpriteLoader
API requires a PNG to be present, even if none of its contents will be used, since the metadata (.mcmeta
file) specifying the loader is attached to that PNG.Unless anyone can think of or has a use case that cannot be replicated with a
SpriteSource
, theITextureAtlasSpriteLoader
API should be deprecated for removal since it is entirely redundant now.The text was updated successfully, but these errors were encountered: