Class VelocitySignals
java.lang.Object
me.tamkungz.signals.velocity.VelocitySignals
- All Implemented Interfaces:
EventSignalSource
Small bridge from Velocity events to GEB-backed signals.
Common events are grouped by domain: players(), servers() and proxy(). Any other
Velocity event type is available through EventSignalSource.on(Class).
Velocity runs handlers on its own thread pools, so listeners connected here may be called from any thread.
-
Method Summary
Modifier and TypeMethodDescriptionme.tamkungz.signals.SignalBusbus()Returns the signal bus behind this bridge.static VelocitySignalsCreates a bridge with its own signal bus.static VelocitySignalscreate(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, me.tamkungz.signals.SignalBus bus) Creates a bridge on an existing signal bus.players()Returns shortcuts for player events.proxy()Returns shortcuts for proxy events.servers()Returns shortcuts for backend server events.static VelocitySignalsshared()Returns the bridge shared by every plugin through the installed SignalsLib plugin.static me.tamkungz.signals.SignalBusReturns the signal bus shared by every plugin through the installed SignalsLib plugin.<T> me.tamkungz.signals.Signal<T> Returns the signal for an event type with the given post order.static <T> me.tamkungz.signals.Signal<T> standaloneSignal(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, Class<T> eventType) Creates a private bridge for a single event type atPostOrder.NORMALand returns its signal.static <T> me.tamkungz.signals.Signal<T> standaloneSignal(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, Class<T> eventType, com.velocitypowered.api.event.PostOrder order) Creates a private bridge for a single event type and returns its signal.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventSignalSource
on, signal
-
Method Details
-
create
public static VelocitySignals create(Object plugin, com.velocitypowered.api.proxy.ProxyServer server) Creates a bridge with its own signal bus.Velocity handlers are registered lazily, the first time a signal is requested, so the plugin must be loaded by then (for example from
ProxyInitializeEventon).- Parameters:
plugin- plugin instance that owns the Velocity handlersserver- the proxy- Returns:
- a new bridge
-
create
public static VelocitySignals create(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, me.tamkungz.signals.SignalBus bus) Creates a bridge on an existing signal bus.- Parameters:
plugin- plugin instance that owns the Velocity handlersserver- the proxybus- bus the signals live on- Returns:
- a new bridge
-
standaloneSignal
public static <T> me.tamkungz.signals.Signal<T> standaloneSignal(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, Class<T> eventType, com.velocitypowered.api.event.PostOrder order) Creates a private bridge for a single event type and returns its signal.- Type Parameters:
T- event type- Parameters:
plugin- plugin instance that owns the Velocity handlerserver- the proxyeventType- Velocity event typeorder- order in which the Velocity handler runs- Returns:
- the signal for that event type
-
standaloneSignal
public static <T> me.tamkungz.signals.Signal<T> standaloneSignal(Object plugin, com.velocitypowered.api.proxy.ProxyServer server, Class<T> eventType) Creates a private bridge for a single event type atPostOrder.NORMALand returns its signal.- Type Parameters:
T- event type- Parameters:
plugin- plugin instance that owns the Velocity handlerserver- the proxyeventType- Velocity event type- Returns:
- the signal for that event type
-
bus
public me.tamkungz.signals.SignalBus bus()Returns the signal bus behind this bridge.- Returns:
- the signal bus
-
signal
public <T> me.tamkungz.signals.Signal<T> signal(Class<T> eventType, com.velocitypowered.api.event.PostOrder order) Description copied from interface:EventSignalSourceReturns the signal for an event type with the given post order.- Specified by:
signalin interfaceEventSignalSource- Type Parameters:
T- event type- Parameters:
eventType- Velocity event typeorder- order in which the underlying Velocity handler runs relative to other handlers- Returns:
- the signal for that combination
-
players
-
servers
-
proxy
-