BedrockPackMerger

public final class BedrockPackMerger

Merges N Bedrock resource pack zips (one per backend in a network) into a single Bedrock pack zip that the proxy can hand to Geyser. Each backend has already run BedrockConversion locally and produced its own ResourcePackManager_Bedrock.zip; this merger does a file-level union across all of them, JSON-merges textures/item_texture.json, and regenerates a fresh manifest.json pinned to a stable proxy-side UUID so Bedrock clients cache the merged pack across re-merges.

Conflict policy on plain-file path collisions is last writer wins, mirroring the existing Java-side mixer's higher-priority-pack-wins behaviour. Backends are processed in the order supplied to merge, so callers control priority by ordering the input list.

The manifest is always regenerated — never copied from an input — so the merged pack always carries the proxy's stable UUID instead of any individual backend's per-instance UUID. This matches the documented "Edge case: one input" requirement.

Pure JDK + Gson. No Bukkit / Velocity / Geyser API.

Constructors

Link copied to clipboard
public void BedrockPackMerger(MixerLogger logger)

Functions

Link copied to clipboard
public File merge(List<File> inputZips, File outputZip, UUID stableMergedPackUuid)
Merge N Bedrock pack zips into one.
Link copied to clipboard
public static String shortHash(String input)
Canonical 8-char short-hash for Bedrock-safe file names: first nibble mapped to a letter (a..p) so the result can never be all-digits (which Bedrock's item-ID parser rejects as a legacy aux-value), remaining 7 nibbles hex.