Links
Tags
Creators
Details
1.5.0
Compatibility
Changes
⚡ Relay v1.5.0 — Unified Multi-Thread Scheduler (Folia & Paper)
Relay v1.5.0 introduces SchedulerService, a unified, cross-platform task scheduling and multi-threading engine designed to bridge the gap between Folia's regional multi-threaded architecture and traditional Paper/Spigot single-thread environments.
🌟 What's New?
1. 🧵 Unified Folia & Paper Scheduler (SchedulerService)
No more NoSuchMethodError, UnsupportedOperationException, or unsafe Bukkit synchronous calls on Folia. Relay automatically detects the server platform at runtime and routes tasks deterministically:
- Entity-Bound Scheduling (
runFor,runForLater,runForRepeating): Executes safely on the regional thread owning the player or entity. Auto-cancels if the entity becomes invalid or logs off. - Region & Location Scheduling (
runAt,runAtLater,runAtRepeating): Binds tasks to Folia'sRegionSchedulerfor block mutations, particle spawns, and area-of-effect spells without thread deadlocks. - Global Tick Scheduling (
runGlobal,runGlobalLater,runGlobalRepeating): Routes to Folia'sGlobalRegionScheduler(or Paper's main thread) for server-wide broadcasts and world cycles. - Async Workers (
runAsync,runAsyncLater,runAsyncRepeating): Non-blocking execution backed by Folia'sAsyncScheduleror high-performance background executor pools.
2. ⚡ CompletableFuture Async Promises
- Seamless non-blocking asynchronous data pipelines via
supplyAsyncPromise(Supplier<T>)andrunAsyncPromise(Runnable). Easily chain database or web queries and pipe results directly into an entity's regional thread.
3. 🛡️ Runtime Thread Safety Assertions
- Safely assert thread contexts without reflection boilerplate:
scheduler.isEntityThread(entity)scheduler.isRegionThread(location)scheduler.isGlobalTickThread()
4. 🧹 Zero-Leak Task Cancellation
- Consumer plugins no longer leave zombie tasks behind upon reload or disable. Relay automatically tracks task ownership and calls
cancelAll(plugin)on server shutdown or plugin unload. - Real-time inspection added to
/relay status(Active Tasks: X).
📦 Dependency (v1.5.0)
Gradle (Kotlin DSL)
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
compileOnly("com.github.Kriscra.Relay:relay-api:v1.5.0")
}
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:xtLEzIfs:pV0hfrgm"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:xtLEzIfs:pV0hfrgm"
}
