Code Monkey home page Code Monkey logo

mccoroutine's Introduction

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 a library, which adds extensive support for Kotlin Coroutines for Minecraft Server environments.

Plugins for game servers and proxy servers often need to perform asynchronous operations (e.g. accessing databases) to be scalable for a large amount of players. MCCoroutine brings the full power of Kotlin Coroutines to them by extending the existing APIs with suspendable commands, events and schedules.

Supported Game Servers:

  • CraftBukkit
  • Fabric
  • Folia
  • Minestom
  • Paper
  • Spigot
  • SpongeVanilla v7.x.x
  • SpongeForge v7.x.x

Supported Proxies:

  • BungeeCord
  • Waterfall
  • Velocity

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
    }
}
// Adds a new extension function to switch into a suspendable plugin coroutine.
fun bar() {
    plugin.launch {
        delay(1000)
        bob()
    }
}

private suspend fun bob() {
}

Getting started

Resources

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.

mccoroutine's People

Contributors

shynixn avatar spliterash avatar geeyoueye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.