1 Commits

Author SHA1 Message Date
kayjaydee a0ad12b208 feat(binding): add AsyncPlugin as entry point for Async library
Introduces AsyncPlugin to serve as a standalone library-plugin entry point for the Async library. This allows other plugins to depend on Async without bundling it directly. The plugin installs a disconnect hook on start and ensures proper shutdown of tracked scopes.
2026-04-28 18:25:22 +02:00
2 changed files with 39 additions and 0 deletions
@@ -0,0 +1,23 @@
package com.mythlane.async.binding
import com.hypixel.hytale.server.core.plugin.JavaPlugin
import com.hypixel.hytale.server.core.plugin.JavaPluginInit
import com.mythlane.async.Async
/**
* Standalone library-plugin entry point. Drop the shaded jar in `mods/` and
* other plugins can depend on Async without bundling it themselves.
*
* Installs the disconnect hook on start and drains every tracked scope on
* shutdown. Plugins that bundle Async directly should keep calling
* [installAsync] and [Async.shutdown] themselves and not rely on this class.
*/
class AsyncPlugin(init: JavaPluginInit) : JavaPlugin(init) {
override fun start() {
installAsync()
}
override fun shutdown() {
Async.shutdown()
}
}
+16
View File
@@ -0,0 +1,16 @@
{
"Group": "Mythlane",
"Name": "Async",
"Version": "0.1.0",
"Description": "Kotlin coroutines for Hytale plugins. Thread-safe ECS access, off-thread blocking I/O, and automatic cancellation on disconnect or world unload.",
"Authors": [
{ "Name": "Mythlane", "Email": "contact@mythlane.com", "Url": "https://mythlane.com" }
],
"Website": "https://mythlane.com",
"Main": "com.mythlane.async.binding.AsyncPlugin",
"ServerVersion": "2026.03.26-89796e57b",
"Dependencies": {},
"OptionalDependencies": {},
"DisabledByDefault": false,
"IncludesAssetPack": false
}