Handling notifications
Runtime: shared API plus recorder/player bindings · Use it for: save, playback, and catalogue notifications Follow the event guide to choose the correct notification and completion thread. The save event may be asynchronous. Copy the values you need and schedule Bukkit-facing work onto the main thread. A stop event is a post-cleanup playback notification, not a cancellation hook. This teaching example imports both role APIs. Split it into role-specific listeners for independently deployed recorder and player integrations; do not eagerly resolve an absent role’s event classes. The catalogue handlers use the shared API and only log, so they need no Bukkit thread dispatch. They observe calls through the runtime’s catalogue wrapper, not arbitrary raw backend calls. A refused metadata update still emits a result; an exceptional update does not emitReplayMetadataUpdatedEvent. Retain stage failure handling for that case. A deletion stage failure emits ReplayDeletedEvent with its cause. Synchronous failures before a backend stage is returned do not guarantee either event.
Observe lobby dispatch separately
In a lobby-only listener, importcom.marioded.reverse.api.lobby.event.DispatchResultEvent and com.marioded.reverse.api.lobby.service.DispatchService. This handler only logs and is safe on the event’s completion thread:
JavaPlugin implementing Listener, registered as above with a dependency on reverse-lobby. The event can fire inline for an offline/overlapping request or on a backend completion thread; its viewer handle may already be offline. Schedule any player/UI work onto the main thread and recheck the connection. SUCCESS means a handoff was sent, not that playback began. See dispatch event semantics for exceptional stages and converted failures.
