AtlasSpriteIndex

public final class AtlasSpriteIndex

Index of Minecraft atlas sprite remaps found in a merged Java pack.

Vanilla resource packs may rename a texture's sprite via an atlas single source: a model can reference "layer0": "ns:short" while the actual PNG lives somewhere else entirely, with the link declared in assets/<ns>/atlases/<atlas>.json:

{ "type": "single", "resource": "inkless:vanillasets/cake_sword", "sprite": "ia:627" } 
The Java client stitches the resource texture into the atlas under the sprite name, so ia:627 resolves at render time — but only through the atlas. ItemsAdder 4.x leans on this heavily: every auto item texture is remapped to a short ia:<number> sprite, so a naive "treat the texture ref as a file path" resolver looks for assets/ia/textures/627.png (which does not exist) and fails for the entire pack.

This index walks every .../atlases/*.json in the merged pack — including the ones ItemsAdder ships inside pack overlays (e.g. ia_overlay_modern_atlas/) — and records sprite -> resource for each single source whose sprite name differs from its resource. AssetResolver consults it to rewrite a resolved model's textures block back to real texture locations before any Bedrock stitching / icon / geometry step runs.

Only single sources carry an explicit sprite rename; directory, filter, unstitch, and paletted_permutations sources derive sprite names from real file paths and need no remap, so they are ignored here.

Functions

Link copied to clipboard
public static AtlasSpriteIndex build(File packRoot)
Walks packRoot for atlas JSON files and builds the sprite-remap index.
Link copied to clipboard
public boolean isEmpty()
Link copied to clipboard
public String resolve(String textureRef)
Returns the real texture resource a sprite ref maps to, or the ref unchanged when it is not an atlas sprite remap (the common case for non-ItemsAdder packs).
Link copied to clipboard
public int size()