toddharrison / MCCoroutine

MCCoroutine is an extension to bukkit and sponge server implementations (Spigot, Paper, SpongeVanilla, SpongeForge etc.) to use Kotlin Coroutines (async,await) for all common operations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MCCoroutine Build Status GitHub license

branch status version download
master Build Status GitHub license Download latest release
development Build Status GitHub license Download snapshots

MCCoroutine is an extension to bukkit and sponge server implementations (Spigot, Paper, SpongeVanilla, SpongeForge etc.) to use Kotlin Coroutines (async,await) for all common operations.

Examples:

// Allows to prepend suspend to any listener function.
class PlayerConnectListener : Listener {
    @EventHandler
    suspend fun onPlayerJoinEvent(playerJoinEvent: PlayerJoinEvent) {
    }
}
// Adds a new interface for suspendable command executors
class AdminCommandExecutor: SuspendingCommandExecutor {
    override suspend fun onCommand(sender: CommandSender,command: Command,label: String,args: Array<out String>): Boolean {
        return false
    }
}

Getting started

Features

  • Full implementation of Kotlin Coroutines (async/await)
  • Extension functions for already established functions
  • Connection to events, commands, schedulers
  • Coroutine LifeCycle scope for plugins (supports plugin reloading)
  • No NMS
  • Support for Minecraft 1.7 - Latest
  • Support for Java 8

Contributing

  • Fork the MCCoroutine project on github and clone it to your local environment
  • Install Java 8+
  • Execute gradle sync for dependencies

Licence

The source code is licensed under the MIT license.

About

MCCoroutine is an extension to bukkit and sponge server implementations (Spigot, Paper, SpongeVanilla, SpongeForge etc.) to use Kotlin Coroutines (async,await) for all common operations.

License:Other


Languages

Language:Kotlin 97.7%Language:Java 2.3%