Java API
class

VelocitySignals

me.tamkungz.signals.velocity.VelocitySignals

Version
0.2.1-SNAPSHOT
Java
21
Source file
me/tamkungz/signals/velocity/VelocitySignals.java
Repository
View source ↗

Small bridge from Velocity events to GEB-backed signals.

<p>

Common events are grouped by domain: {@link #players()}, {@link #servers()} and {@link #proxy()}. Any other

Velocity event type is available through {@link #on(Class)}.

<p>

Velocity runs handlers on its own thread pools, so listeners connected here may be called from any thread.

public final class VelocitySignals implements EventSignalSource

Methods 11

create

public static VelocitySignals create(Object plugin, ProxyServer server)

Creates a bridge with its own signal bus. <p> Velocity handlers are registered lazily, the first time a signal is requested, so the plugin must be loaded by then (for example from {@code ProxyInitializeEvent} on).

@param
plugin plugin instance that owns the Velocity handlers
@param
server the proxy
@return
a new bridge

create

public static VelocitySignals create(Object plugin, ProxyServer server, SignalBus bus)

Creates a bridge on an existing signal bus.

@param
plugin plugin instance that owns the Velocity handlers
@param
server the proxy
@param
bus bus the signals live on
@return
a new bridge

shared

public static VelocitySignals shared()

Returns the bridge shared by every plugin through the installed SignalsLib plugin.

@return
the shared bridge

sharedBus

public static SignalBus sharedBus()

Returns the signal bus shared by every plugin through the installed SignalsLib plugin.

@return
the shared bus

standaloneSignal

public static <T> Signal<T> standaloneSignal( Object plugin, ProxyServer server, Class<T> eventType, PostOrder order )

Creates a private bridge for a single event type and returns its signal.

@param
plugin plugin instance that owns the Velocity handler
@param
server the proxy
@param
eventType Velocity event type
@param
order order in which the Velocity handler runs
@param
<T> event type
@return
the signal for that event type

standaloneSignal

public static <T> Signal<T> standaloneSignal(Object plugin, ProxyServer server, Class<T> eventType)

Creates a private bridge for a single event type at {@link PostOrder#NORMAL} and returns its signal.

@param
plugin plugin instance that owns the Velocity handler
@param
server the proxy
@param
eventType Velocity event type
@param
<T> event type
@return
the signal for that event type

bus

public SignalBus bus()

Returns the signal bus behind this bridge.

@return
the signal bus

signal

@Override public <T> Signal<T> signal(Class<T> eventType, PostOrder order)

players

public PlayerSignals players()

Returns shortcuts for player events.

@return
player signals

servers

public ServerSignals servers()

Returns shortcuts for backend server events.

@return
server signals

proxy

public ProxySignals proxy()

Returns shortcuts for proxy events.

@return
proxy signals