Class SignalsVelocityPlugin
java.lang.Object
me.tamkungz.signals.velocity.SignalsVelocityPlugin
Velocity plugin entrypoint for proxies that want to load SignalsLib as a shared library.
The plugin id is signalslib; other plugins list it as a dependency and use
VelocitySignals.shared(). Its velocity-plugin.json is written by hand instead of being
generated from @Plugin, so the version always follows the build.
-
Constructor Summary
ConstructorsConstructorDescriptionSignalsVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger) Called by Velocity. -
Method Summary
Modifier and TypeMethodDescriptionme.tamkungz.signals.SignalBusbus()Returns the signal bus shared by every plugin.me.tamkungz.signals.connection.ConnectionGroupReturns the group that is disconnected when SignalsLib disables.static SignalsVelocityPluginReturns the loaded SignalsLib plugin.voidonProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event) Cleans up when the proxy shuts down.signals()Returns the bridge shared by every plugin.<T extends me.tamkungz.signals.connection.Connection>
Ttrack(T connection) Tracks a connection so it is disconnected when SignalsLib disables.
-
Constructor Details
-
SignalsVelocityPlugin
@Inject public SignalsVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger) Called by Velocity.- Parameters:
server- the proxylogger- logger of this plugin
-
-
Method Details
-
getInstance
Returns the loaded SignalsLib plugin.- Returns:
- the plugin instance
- Throws:
IllegalStateException- if SignalsLib is not loaded
-
onProxyShutdown
public void onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event) Cleans up when the proxy shuts down.- Parameters:
event- shutdown event
-
signals
Returns the bridge shared by every plugin.- Returns:
- the shared bridge
-
bus
public me.tamkungz.signals.SignalBus bus()Returns the signal bus shared by every plugin.- Returns:
- the shared bus
-
connections
public me.tamkungz.signals.connection.ConnectionGroup connections()Returns the group that is disconnected when SignalsLib disables.- Returns:
- the plugin's connection group
-
track
public <T extends me.tamkungz.signals.connection.Connection> T track(T connection) Tracks a connection so it is disconnected when SignalsLib disables.- Type Parameters:
T- connection type- Parameters:
connection- connection to track- Returns:
- the same connection
-