Class SignalsVelocityPlugin

java.lang.Object
me.tamkungz.signals.velocity.SignalsVelocityPlugin

public final class SignalsVelocityPlugin extends Object
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

    Constructors
    Constructor
    Description
    SignalsVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger)
    Called by Velocity.
  • Method Summary

    Modifier and Type
    Method
    Description
    me.tamkungz.signals.SignalBus
    bus()
    Returns the signal bus shared by every plugin.
    me.tamkungz.signals.connection.ConnectionGroup
    Returns the group that is disconnected when SignalsLib disables.
    Returns the loaded SignalsLib plugin.
    void
    onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event)
    Cleans up when the proxy shuts down.
    Returns the bridge shared by every plugin.
    <T extends me.tamkungz.signals.connection.Connection>
    T
    track(T connection)
    Tracks a connection so it is disconnected when SignalsLib disables.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SignalsVelocityPlugin

      @Inject public SignalsVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger)
      Called by Velocity.
      Parameters:
      server - the proxy
      logger - logger of this plugin
  • Method Details

    • getInstance

      public static SignalsVelocityPlugin 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

      public VelocitySignals 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