Package me.tamkungz.signals.bukkit
Class BukkitSignals
java.lang.Object
me.tamkungz.signals.bukkit.BukkitSignals
- All Implemented Interfaces:
EventSignalSource
Small bridge from Bukkit events to GEB-backed signals.
Common events are grouped by domain: players(), blocks(), entities()
and inventories(). Any other event type is available through EventSignalSource.on(Class).
-
Method Summary
Modifier and TypeMethodDescriptionblocks()Returns shortcuts for block events.me.tamkungz.signals.SignalBusbus()Returns the signal bus behind this bridge.static BukkitSignalscreate(org.bukkit.plugin.Plugin plugin) Creates a bridge with its own signal bus.static BukkitSignalscreate(org.bukkit.plugin.Plugin plugin, me.tamkungz.signals.SignalBus bus) Creates a bridge on an existing signal bus.entities()Returns shortcuts for entity events.Returns shortcuts for inventory events.players()Returns shortcuts for player events.static BukkitSignalsshared()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 extends org.bukkit.event.Event>
me.tamkungz.signals.Signal<T> Returns the signal for an event type with the given options.static <T extends org.bukkit.event.Event>
me.tamkungz.signals.Signal<T> standaloneSignal(org.bukkit.plugin.Plugin plugin, Class<T> eventType) Creates a private bridge for a single event type atEventPriority.NORMALand returns its signal.static <T extends org.bukkit.event.Event>
me.tamkungz.signals.Signal<T> standaloneSignal(org.bukkit.plugin.Plugin plugin, Class<T> eventType, org.bukkit.event.EventPriority priority, boolean ignoreCancelled) Creates a private bridge for a single event type and returns its signal.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.tamkungz.signals.bukkit.event.EventSignalSource
on, signal
-
Method Details
-
create
Creates a bridge with its own signal bus.- Parameters:
plugin- plugin that owns the Bukkit listeners- Returns:
- a new bridge
-
create
public static BukkitSignals create(org.bukkit.plugin.Plugin plugin, me.tamkungz.signals.SignalBus bus) Creates a bridge on an existing signal bus.- Parameters:
plugin- plugin that owns the Bukkit listenersbus- bus the signals live on- Returns:
- a new bridge
-
standaloneSignal
public static <T extends org.bukkit.event.Event> me.tamkungz.signals.Signal<T> standaloneSignal(org.bukkit.plugin.Plugin plugin, Class<T> eventType, org.bukkit.event.EventPriority priority, boolean ignoreCancelled) Creates a private bridge for a single event type and returns its signal.- Type Parameters:
T- event type- Parameters:
plugin- plugin that owns the Bukkit listenereventType- Bukkit event typepriority- priority the Bukkit listener runs atignoreCancelled- whether cancelled events are skipped- Returns:
- the signal for that event type
-
standaloneSignal
public static <T extends org.bukkit.event.Event> me.tamkungz.signals.Signal<T> standaloneSignal(org.bukkit.plugin.Plugin plugin, Class<T> eventType) Creates a private bridge for a single event type atEventPriority.NORMALand returns its signal.- Type Parameters:
T- event type- Parameters:
plugin- plugin that owns the Bukkit listenereventType- Bukkit 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 extends org.bukkit.event.Event> me.tamkungz.signals.Signal<T> signal(Class<T> eventType, org.bukkit.event.EventPriority priority, boolean ignoreCancelled) Description copied from interface:EventSignalSourceReturns the signal for an event type with the given options.- Specified by:
signalin interfaceEventSignalSource- Type Parameters:
T- event type- Parameters:
eventType- Bukkit event typepriority- priority the underlying Bukkit listener runs atignoreCancelled- whether cancelled events are skipped- Returns:
- the signal for that combination
-
players
Returns shortcuts for player events.- Returns:
- player signals
-
blocks
Returns shortcuts for block events.- Returns:
- block signals
-
entities
Returns shortcuts for entity events.- Returns:
- entity signals
-
inventories
Returns shortcuts for inventory events.- Returns:
- inventory signals
-