Units your code controls
The Paper and Velocity helper
Phase 2, in development. This page describes the design of zaroz-minecraft-helper (Java 21, Gradle, MIT). Names and options may change until the first 1.x release, which is versioned with the contract major.
| Module | What it is |
|---|---|
common | contract client (reads /zaroz/*.json, signal socket and long-polls), Units API client (authenticates with /zaroz/credentials/token, re-reading it on 401), webhook signature verifier, typed events |
paper | a plugin for Paper servers |
velocity | a plugin for Velocity proxies |
Paper
- Signals
readyafterServerLoadEvent. - Signals
busyon the first join andidleafteridle_grace_secondswith no players (configurable). - Signals
accepting falseat your configured capacity andtruebelow it. - Registers a
ZarozUnitservice (BukkitServicesManager) with the key, labels,user_dataand allocation, and firesUnitAllocatedEventwhen an allocation arrives. - On the draining notice it sends a configurable message and asks the proxy to move players to a lobby before SIGTERM.
World persistence stays yours: download on start, upload on SIGTERM, to your own bucket.
Code
Velocity
- Keeps the proxy's server list in sync with one or more Workloads: it lists ready units and follows the event long-poll (
unit.readyadds<key>.<workload>,unit.drainingandunit.destroyedremove it). - Balances joins across accepting lobbies.
- A duel API for your plugins:
allocateon a configured Workload with the party inuser_data, then it sends the players whenunit.allocation_deliveredarrives. - A plot API: create by key with
start: true, and wait forunit.ready.
The proxy's Workload needs a service principal with units.control on the Workloads it creates units in and units.read on the ones it only watches.
See the example-game-network repository for a complete network built with it.
Last modified on
