coroutine-based kotlin minecraft game engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Coroutine Integration#

Axi provides great coroutine integration to Minecraft using MCCoroutine ↗.

Extensions#

Axi adds the following extensions:

  • AxiPlugin.coroutineScope: The coroutine scope of the plugin
  • AxiPlugin.syncContext: The synchronously executed coroutine context of the plugin, with an exception handler that prints stack traces for coroutine exceptions
  • AxiPlugin.asyncContext: The asynchronously executed coroutine context of the plugin, with an exception handler that prints stack traces for coroutine exceptions
  • AxiPlugin.sync: Launches a synchronously executed job
  • AxiPlugin.async: Launches an asynchronously executed job
  • AxiPlugin.syncContext(): Switches to the AxiPlugin.syncContext
  • AxiPlugin.asyncContext(): Switches to the AxiPlugin.asyncContext

All of these exist for the main plugin as well with the AxiCoroutines object.

Suspending Events#

You can register event handlers with suspending handler functions using AxiPlugin.registerEventListeners.

There is also another utility provided by Axi: SuspendingListener, an interface that implements Listener and is a synchronous CoroutineScope. This is useful if you want to launch jobs in your events.