RefineryBus (xyz.refineryteam.refinerycore.api.event) is a process-wide, string-keyed publish/subscribe bus for lightweight cross-plugin signaling. Unlike Bukkit events, channels are just strings, so one plugin can publish on a channel and another can subscribe to it without either plugin depending on the other’s classes at compile time.
This is meant for lightweight signaling — notify, refresh, sync. For anything that needs to be cancellable or intercepted mid-flow, use a real Bukkit
Event instead.Publishing
EconomyManager.java
Subscribing
EconomyManager.java
type are delivered to that subscriber, so multiple unrelated payload shapes can technically share a channel name (though using separate channel names per payload shape is usually clearer).
RefineryBus.java
subscribe returns a UUID handle you can pass to unsubscribe(channel, id) later.
Payloads are plain objects — records work well — shared by convention: both the publisher and subscriber need to agree on the payload’s shape, typically documented per channel name or via a small shared “API” module.
Cleaning up — BusSubscriptions
Manually tracking every subscription UUID to unsubscribe them on plugin disable is tedious, so BusSubscriptions groups them for you:
MyPlugin.java

