MCCoroutine Kotlin协程支持扩展

Kotlin 的 MCCoroutine 扩展,能让你在写 Spigot 或 Paper 插件时直接用协程来异步任务,代码清爽不少。像监听事件、操作玩家数据这些事,用协程起来不光写得少,逻辑也更清晰。之前要配合各种回调、线程,现在一句方法就能搞定,响应也快。

MCCoroutine的优势在于跟 Kotlin 原生协程配合得挺好,你用惯了launchwithContext,这套用在 Bukkit API 上一点都不违和。比如注册监听器,只要一行:

server.pluginManager.registerSuspendingEvents(PlayerConnectListener(), plugin)

支持 Spigot、Paper、SpongeVanilla、SpongeForge 这些主流服务器,基本覆盖了日常开发需求。用惯 Java 写插件的朋友,初次接触 Kotlin 也不难上手,多看看文档就知道套路了。

如果你已经在用KSpigot或想整合kotlinx.coroutines,MCCoroutine 兼容性也不错,不冲突。推荐顺带看看这些:

如果你平时开发插件碰到线程切换麻烦、事件写起来啰嗦,那试试 MCCoroutine 挺值当的。

folder
MCCoroutine:MCCoroutine是bukkit服务器实现(Spigot,Paper等)的扩展,可将Kotlin Coroutines(也称为asyncawait)模式用于所有常用操作 预估大小:104个文件
file
gradlew.bat 2KB
file
gradlew 5KB
file
help-doc.html 8KB
file
package-summary.html 5KB
file
ExtensionKt.html 19KB
file
SuspendingCommandExecutor.html 8KB
file
package-summary.html 6KB
file
EventService.html 8KB
file
package-tree.html 5KB
file
CoroutineSession.html 13KB
file
MCCoroutine.html 9KB
file
CommandService.html 8KB
file
package-summary.html 5KB
file
MCCoroutineImpl.html 10KB
file
stylesheet.css 13KB
file
index-all.html 19KB
file
overview-tree.html 6KB
file
travis_secret_key.gpg 5KB
file
.gitignore 44B
file
build.gradle 6KB
zip 文件大小:190.39KB