GeyserPackProvider

public final class GeyserPackProvider

Serves the latest mixed Bedrock resource pack per-session via Geyser's SessionLoadResourcePacksEvent. This replaces the previous approach of copying the pack zip into <Geyser>/packs/ at startup — that copy was always one server-boot behind because Geyser only scans packs/ at its own startup, so the pack served to Bedrock clients was the pack from the PREVIOUS run, not the current mix. Worse, that stale pack stayed in Geyser's memory for the rest of the session even after RSPM regenerated the pack on disk, so the only way to recover was to delete the output folder and restart.

With this provider, every Bedrock joiner reads the pack live from <plugin>/output/ResourcePackManager_Bedrock.zip. path delegates to Geyser's GeyserPathPackCodec which re-opens the file per serialize() call and invalidates its sha256/size cache when the file's mtime changes. So if RSPM finishes mixing while the server is running, the NEXT Bedrock player to join gets the fresh pack with no server restart.

Currently-connected Bedrock players keep the pack they received at their own join time — that's a Bedrock protocol constraint (pack handshake happens at connection time), not something this code controls.

Custom-item mappings (rspm_geyser_mappings.json) are NOT served by this class — they're boot-frozen by Geyser, so GeyserDeployer still copies them to disk for next boot.

Functions

Link copied to clipboard
public static void register()
Registers a SessionLoadResourcePacksEvent subscriber so every Bedrock joiner picks up the latest mixed pack from disk.
Link copied to clipboard
public static void unregister()
Unregisters all our Geyser event subscriptions.