Java API
class

BukkitSignals

me.tamkungz.signals.bukkit.BukkitSignals

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

Small bridge from Bukkit events to GEB-backed signals.

<p>

Common events are grouped by domain: {@link #players()}, {@link #blocks()}, {@link #entities()}

and {@link #inventories()}. Any other event type is available through {@link #on(Class)}.

public final class BukkitSignals implements EventSignalSource

Methods 12

create

public static BukkitSignals create(Plugin plugin)

Creates a bridge with its own signal bus.

@param
plugin plugin that owns the Bukkit listeners
@return
a new bridge

create

public static BukkitSignals create(Plugin plugin, SignalBus bus)

Creates a bridge on an existing signal bus.

@param
plugin plugin that owns the Bukkit listeners
@param
bus bus the signals live on
@return
a new bridge

shared

public static BukkitSignals 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 extends Event> Signal<T> standaloneSignal( Plugin plugin, Class<T> eventType, EventPriority priority, boolean ignoreCancelled )

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

@param
plugin plugin that owns the Bukkit listener
@param
eventType Bukkit event type
@param
priority priority the Bukkit listener runs at
@param
ignoreCancelled whether cancelled events are skipped
@param
<T> event type
@return
the signal for that event type

standaloneSignal

public static <T extends Event> Signal<T> standaloneSignal(Plugin plugin, Class<T> eventType)

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

@param
plugin plugin that owns the Bukkit listener
@param
eventType Bukkit 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 extends Event> Signal<T> signal(Class<T> eventType, EventPriority priority, boolean ignoreCancelled)

players

public PlayerSignals players()

Returns shortcuts for player events.

@return
player signals

blocks

public BlockSignals blocks()

Returns shortcuts for block events.

@return
block signals

entities

public EntitySignals entities()

Returns shortcuts for entity events.

@return
entity signals

inventories

public InventorySignals inventories()

Returns shortcuts for inventory events.

@return
inventory signals