A fluent scheduling utility for Minecraft plugins, providing elegant async/sync runnable chaining with Bukkit/Spigot/Paper/Velocity integration.
- 🧵 Fluent API for async/sync task chaining
- ⏱️ Built-in delay support with tick/Duration precision
- 🚫 Stage cancellation support
- 🔒 Thread-safe error handling
- 🧩 Custom thread pool integration
The bukkit
& velocity
modules depend on common
. Additionally you should shade the dependency into your plugin jar.
Gradle Kotlin DSL
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.milkdrinkers:threadutil-common:1.0.0")
implementation("io.github.milkdrinkers:threadutil-bukkit:1.0.0")
implementation("io.github.milkdrinkers:threadutil-velocity:1.0.0")
}
Maven
<project>
<dependencies>
<dependency>
<groupId>io.github.milkdrinkers</groupId>
<artifactId>threadutil-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.github.milkdrinkers</groupId>
<artifactId>threadutil-bukkit</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>io.github.milkdrinkers</groupId>
<artifactId>threadutil-velocity</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
import io.github.milkdrinkers.threadutil.Scheduler;
Scheduler.async(() -> {
// Async database operation
return fetchPlayerData(player.getUniqueId());
})
.delay(Duration.ofSeconds(1))
.delay(1) // Wait one game tick on supported platforms
.sync(data -> {
// Sync UI update
player.sendMessage("Loaded: " + data.toString());
return data.process();
})
.async(processed -> {
// Async file I/O
saveToFile(processed);
return processed;
})
.execute();
git clone https://github.com/milkdrinkers/ThreadUtil.git
cd threadutil
./gradlew publishToMavenLocal
Contributions are always welcome! Please make sure to read our Contributor's Guide for standards and our Contributor License Agreement (CLA) before submitting any pull requests.
We also ask that you adhere to our Contributor Code of Conduct to ensure this community remains a place where all feel welcome to participate.
You can find the license the source code and all assets are under here. Additionally, contributors agree to the Contributor License Agreement (CLA) found here.