Package-level declarations

Types

Link copied to clipboard

Facade of a coroutine session of a single extension or entire server.

Link copied to clipboard
interface MCCoroutine

Hidden internal MCCoroutine interface.

Link copied to clipboard

Additional configurations for MCCoroutine and communication.

Link copied to clipboard

A Fabric event which is called when an exception is raised in one of the coroutines managed by MCCoroutine. Cancelling this exception causes the error to not get logged and offers to possibility for custom logging.

Link copied to clipboard

See https://shynixn.github.io/MCCoroutine/wiki/site/plugindisable for more details.

Link copied to clipboard

A suspending interface of the default command.

Properties

Link copied to clipboard
val <Error class: unknown class>.mcCoroutineConfiguration: MCCoroutineConfiguration
val <Error class: unknown class>.mcCoroutineConfiguration: MCCoroutineConfiguration
val <Error class: unknown class>.mcCoroutineConfiguration: MCCoroutineConfiguration

Gets the configuration instance of MCCoroutine.

Link copied to clipboard
val <Error class: unknown class>.minecraftDispatcher: CoroutineContext
val <Error class: unknown class>.minecraftDispatcher: CoroutineContext
val <Error class: unknown class>.minecraftDispatcher: CoroutineContext

Gets the extension minecraft dispatcher.

Link copied to clipboard
val <Error class: unknown class>.scope: <Error class: unknown class>
val <Error class: unknown class>.scope: <Error class: unknown class>
val <Error class: unknown class>.scope: <Error class: unknown class>

Gets the coroutine scope.

Link copied to clipboard

Converts the number to ticks for being used together with delay(..). E.g. delay(1.ticks). Minecraft ticks 20 times per second, which means a tick appears every 50 milliseconds. However, delay() does not directly work with the MinecraftScheduler and needs millisecond manipulation to work as expected. Therefore, 1 tick does not equal 50 milliseconds when using this method standalone and only sums up to 50 milliseconds if you use it together with delay.

Functions

Link copied to clipboard
fun <S, T> <Error class: unknown class><S, T>.executesSuspend(owner: <Error class: unknown class>, command: SuspendingCommand<S>): T
fun <S, T> <Error class: unknown class><S, T>.executesSuspend(owner: <Error class: unknown class>, command: SuspendingCommand<S>): T
fun <S, T> <Error class: unknown class><S, T>.executesSuspend(owner: <Error class: unknown class>, command: SuspendingCommand<S>): T

Works in the same way as executes but offers the possibility for suspension.

Link copied to clipboard
fun <Error class: unknown class>.launch(    context: CoroutineContext = minecraftDispatcher,     start: <Error class: unknown class> = CoroutineStart.DEFAULT,     block: suspend <Error class: unknown class>.() -> Unit): <Error class: unknown class>
fun <Error class: unknown class>.launch(    context: CoroutineContext = minecraftDispatcher,     start: <Error class: unknown class> = CoroutineStart.DEFAULT,     block: suspend <Error class: unknown class>.() -> Unit): <Error class: unknown class>
fun <Error class: unknown class>.launch(    context: CoroutineContext = minecraftDispatcher,     start: <Error class: unknown class> = CoroutineStart.DEFAULT,     block: suspend <Error class: unknown class>.() -> Unit): <Error class: unknown class>

Launches a new coroutine on the minecraft main thread without blocking the current thread and returns a reference to the coroutine as a Job. The coroutine is cancelled when the resulting job is Job.cancel.