BackendIdentity

public final class BackendIdentity

Stable per-backend identifier used as the backendId field when uploading to and downloading from the Bedrock pack relay.

Each backend instance writes a UUID to plugins/ResourcePackManager/backend-id.txt on first run. Subsequent runs read the same file. The proxy doesn't need to know any backend's ID in advance — it asks the relay POST /bedrock/list for all live entries on its network and merges everything it finds. Each backend therefore appears as its own namespace under the network's relay storage, with no collision possible even if backends share an MC port across hosts.

The file format is a single UUID string with optional trailing newline. If the file is corrupted (empty, parse fails), a fresh UUID is generated and the file is rewritten — the previous relay entries under the old ID will TTL-expire on the hoster within minutes.

Functions

Link copied to clipboard
public static String loadOrCreate(Path file)
Load the existing backend ID from file, or create a new one and persist it if the file is absent / corrupt.