Links
Tags
Creators
Details
0.2.4-SNAPSHOT
Compatibility
Changes
0.2.4-SNAPSHOT
Fixes events being dropped on BungeeCord and Velocity when their only listeners live on a sub-bus, and adds
Signal.next, Signal.connectOn, connection-returning dispatcher registration and BukkitSignals.mainThread().
No breaking changes.
Fixed
signals-bungeecord,signals-velocity: the bridges skipped an event whilelistenerCount()of its signal was 0. A listener that only lives on a sub-bus (geb().subBus(...), in the README) therefore never received the event, although it does on Bukkit. They now askhasReceivers, which counts sub-buses.signals-bukkit: the Bukkit handler of a signal stays registered for good, and built and dispatched a value for every event even with no listener connected (everyPlayerMoveEvent, for one). It now skips events nobody can receive, like the other two bridges.- Javadoc:
GebBridge.registerDispatchernow says that a bus keeps one dispatcher per event type and a new one replaces the old one, andunregisterDispatcherthat only the same instance is removed.SignalBus.firenow says that GEB does not catch a listener's exception, so it reaches the caller.SignalBus(IBus)now says that buses sharing a GEB bus see each other's values. All three were checked against GEB 0.5.4.
Added
Signal.next()andSignal.next(Predicate): aCompletableFuturethat completes with the next (matching) value. The listener disconnects when the future completes or is cancelled; a throwing predicate fails the future instead of reaching the code that fires.Signal.connectOn(Executor, Consumer)and theConnectionGroupvariant: run a listener on an executor, to hop to a thread. A task queued before its connection was disconnected is skipped.SignalBus.hasReceivers(Class),SignalBus.hasReceivers(SignalKey)andSignal.hasReceivers(): whether firing could reach a listener, counting sub-buses.GebBridge.hasSubBuses()backs it.GebBridge.dispatcher(IEventDispatcher)andGebBridge.loadDispatchers(ClassLoader), each with aConnectionGroupvariant: register dispatchers and get aConnectionthat unregisters them. On the shared bus, dispatchers registered withregisterDispatcherorloadAndRegisterDispatchersstay behind when the plugin that registered them reloads.loadDispatchersis all or nothing: a broken service file unregisters what was loaded.signals-bukkit:BukkitSignals.mainThread(), anExecutorfor the server's main thread, to use withconnectOnfor off-thread events such asplayers().chat(). Not for Folia.- 24 new
signals-coretests (72 in total, was 48): the exception contract offire,hasReceivers(including a regression test for the sub-bus bug),next(value, predicate, cancel, failing predicate, concurrent fires),connectOn(order, skipped tasks, inline, group, null checks), dispatcher connections (replace, replaced dispatcher kept, rollback, group, null checks), sub-bus tracking and two buses on one GEB bus.
Changed
GebBridge.loadAndRegisterDispatchersnow delegates toloadDispatchers: same behaviour, except that a broken service file no longer leaves the dispatchers read before it registered.- README:
next,connectOn,mainThread, the dispatcher connections, a warning aboutclear()on a shared bus, and the sub-bus notes. The GEB Direct Use example now cleans up inonDisable. - Version is now
0.2.4-SNAPSHOT.
Supplementary resources
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:UxiIddjL:RD8WfxmW"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:UxiIddjL:RD8WfxmW"
}

