BedrockPackOptimizer

public final class BedrockPackOptimizer

Losslessly consolidates exact duplicate texture files in a generated Bedrock pack. Bedrock JSON refers to textures by path, so duplicate bytes can share a single canonical file once every exact path reference has been rewritten.

This intentionally does not perform perceptual image matching, PNG re-encoding, or deduplication outside textures/. Only byte-identical images with the same file extension are candidates. If an alias occurs in a malformed JSON file, a non-JSON file, or as part of a larger JSON string, the alias file is retained because that reference cannot be rewritten with full structural confidence.

Functions

Link copied to clipboard
public static void deduplicateExactTextures(Path packRoot, MixerLogger logger)
public static void deduplicateExactTextures(Path packRoot, MixerLogger logger, BooleanSupplier cancellationRequested)