TextureStitcher

public class TextureStitcher

Stitches multiple textures from an FMM-style multi-bone model (or a single generic Java item model) into a single atlas PNG. Bedrock geometry only supports one texture per geometry, so multi-texture models must be combined.

Two entry points are provided:

  • stitch — the legacy FMM path: accepts a list of bone JSON files on disk, each representing one bone of an FMM multi-bone model.
  • stitchSingleModel — the generic path: accepts an already-parsed Java item model JSON in memory, treated as a single "bone". Used by the generic Java→Bedrock pipeline (Phase 6) which has the merged-parent JSON in hand and does not want to round-trip through disk.

Both paths share the texture-collection / atlas-building code. The FMM path also emits per-bone item icons for callers that consume them; the generic path renders its own compact inventory icon and skips those source texture copies.

Constructors

Link copied to clipboard
public void TextureStitcher()

Types

Link copied to clipboard
public final class StitchResult extends Record
Result of stitching textures for a model.

Functions

Link copied to clipboard
public static TextureStitcher.StitchResult stitch(String modelName, List<File> boneJsonFiles, File mergedPackRoot, File bedrockPackDir)
Collects all unique textures referenced by bones in a model, stitches them into one atlas, writes it to the Bedrock pack, and returns sprite mapping info.
Link copied to clipboard
public static TextureStitcher.StitchResult stitchSingleModel(String modelName, String boneName, JsonObject javaModel, File mergedPackRoot, File bedrockPackDir)
Generic-pipeline entry point: stitch a single in-memory Java item model into a Bedrock atlas.
Link copied to clipboard
public static void writeIconCroppedIfFlipbook(File source, File dest)
Writes the source PNG to dest.