NetworkSync

public final class NetworkSync

Proxy-side orchestrator. For each backend in the proxy's server list, pulls /bedrock.zip and /mappings.json from the backend's PackHttpServer (via strong ETags, with If-Modified-Since retained for older servers), waits for the inbox to stabilize (identical hashes across adjacent poll cycles — see STABLE_CYCLES_REQUIRED), and then merges every backend's contribution into a single Bedrock pack + single Geyser mappings JSON.

The proxy no longer downloads Java packs, runs a Java-side mixer, runs BedrockConversion, or self-hosts an HTTP server. All of that lives on the backends now; the proxy is a thin file-union step that hands the merged Bedrock pack to Geyser via PackCodec.path.

One instance per network-key. The proxy plugin instantiates it once per startup and starts the polling loop.

Platform-neutral — no imports from org.bukkit, com.velocitypowered, net.md_5.bungee, or org.geysermc. Velocity and Bungee entrypoints wire it up with their own ProxyLogger and ProxySchedulerAdapter implementations.

Constructors

Link copied to clipboard
public void NetworkSync(ProxyLogger logger, ProxySchedulerAdapter scheduler, BackendListProvider backendList, File workingDir, int networkHttpOffset, MixerLogger mixerLogger, File geyserPluginDir, String networkKey, Consumer<MergedPack> onMergedPackReady, Predicate<Path> onPluginUpdateCandidate)

Types

Link copied to clipboard
public final class FetchOutcome extends Record
One backend-path fetch attempt's outcome.
Link copied to clipboard
public final class Snapshot extends Record
Snapshot of NetworkSync state for diagnostic commands.

Functions

Link copied to clipboard
The most recently published merged pack, or null if none yet.
Link copied to clipboard
Read-only snapshot of NetworkSync's current state, suitable for rendering by /rspm status on the proxy side.
Link copied to clipboard
public void start(long initialDelayMillis, long intervalMillis)
Start the polling loop.
Link copied to clipboard
public void stop()
Cancel the polling loop.