Class BungeeSignals

java.lang.Object
me.tamkungz.signals.bungee.BungeeSignals
All Implemented Interfaces:
EventSignalSource

public final class BungeeSignals extends Object implements EventSignalSource
Small bridge from BungeeCord (and Waterfall) events to GEB-backed signals.

Common events are grouped by domain: players(), servers() and proxy(). Any other bridged event type is available through on(Class).

BungeeCord can only register handlers by reflecting over annotated methods, so the bridge covers a fixed list of events (see bridgedEvents()), all at NORMAL priority. For an event outside that list, register a normal BungeeCord listener and fire into bus() yourself.

  • Method Summary

    Modifier and Type
    Method
    Description
    static Set<Class<? extends net.md_5.bungee.api.plugin.Event>>
    Returns the BungeeCord event types this bridge forwards.
    me.tamkungz.signals.SignalBus
    bus()
    Returns the signal bus behind this bridge.
    create(net.md_5.bungee.api.plugin.Plugin plugin)
    Creates a bridge with its own signal bus.
    create(net.md_5.bungee.api.plugin.Plugin plugin, me.tamkungz.signals.SignalBus bus)
    Creates a bridge on an existing signal bus.
    <T extends net.md_5.bungee.api.plugin.Event>
    me.tamkungz.signals.Signal<T>
    on(Class<T> eventType)
    Returns the signal for a bridged BungeeCord event type.
    Returns shortcuts for player events.
    Returns shortcuts for proxy events.
    Returns shortcuts for backend server events.
    Returns the bridge shared by every plugin through the installed SignalsLib plugin.
    static me.tamkungz.signals.SignalBus
    Returns the signal bus shared by every plugin through the installed SignalsLib plugin.

    Methods inherited from class Object

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

    • create

      public static BungeeSignals create(net.md_5.bungee.api.plugin.Plugin plugin)
      Creates a bridge with its own signal bus.
      Parameters:
      plugin - plugin that owns the BungeeCord listener
      Returns:
      a new bridge
    • create

      public static BungeeSignals create(net.md_5.bungee.api.plugin.Plugin plugin, me.tamkungz.signals.SignalBus bus)
      Creates a bridge on an existing signal bus.
      Parameters:
      plugin - plugin that owns the BungeeCord listener
      bus - bus the signals live on
      Returns:
      a new bridge
    • shared

      public static BungeeSignals shared()
      Returns the bridge shared by every plugin through the installed SignalsLib plugin.
      Returns:
      the shared bridge
    • sharedBus

      public static me.tamkungz.signals.SignalBus sharedBus()
      Returns the signal bus shared by every plugin through the installed SignalsLib plugin.
      Returns:
      the shared bus
    • bus

      public me.tamkungz.signals.SignalBus bus()
      Returns the signal bus behind this bridge.
      Returns:
      the signal bus
    • bridgedEvents

      public static Set<Class<? extends net.md_5.bungee.api.plugin.Event>> bridgedEvents()
      Returns the BungeeCord event types this bridge forwards.
      Returns:
      an unmodifiable set of event types
    • on

      public <T extends net.md_5.bungee.api.plugin.Event> me.tamkungz.signals.Signal<T> on(Class<T> eventType)
      Description copied from interface: EventSignalSource
      Returns the signal for a bridged BungeeCord event type.
      Specified by:
      on in interface EventSignalSource
      Type Parameters:
      T - event type
      Parameters:
      eventType - BungeeCord event type
      Returns:
      the signal for that event type
    • players

      public PlayerSignals players()
      Returns shortcuts for player events.
      Returns:
      player signals
    • servers

      public ServerSignals servers()
      Returns shortcuts for backend server events.
      Returns:
      server signals
    • proxy

      public ProxySignals proxy()
      Returns shortcuts for proxy events.
      Returns:
      proxy signals