Package com.github.shynixn.mccoroutine.fabric

Types

CoroutineSession
Link copied to clipboard
interface CoroutineSession

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

MCCoroutine
Link copied to clipboard
interface MCCoroutine

Hidden internal MCCoroutine interface.

MCCoroutineConfiguration
Link copied to clipboard
interface MCCoroutineConfiguration

Additional configurations for MCCoroutine and communication.

MCCoroutineExceptionEvent
Link copied to clipboard
interface MCCoroutineExceptionEvent

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.

ShutdownStrategy
Link copied to clipboard
enum ShutdownStrategy : Enum<ShutdownStrategy>

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

SuspendingCommand
Link copied to clipboard
interface SuspendingCommand<S>

A suspending interface of the default command.

Functions

executesSuspend
Link copied to clipboard
fun <S, T> <ERROR CLASS><S, T>.executesSuspend(owner: <ERROR CLASS>, command: SuspendingCommand<S>): T
fun <S, T> <ERROR CLASS><S, T>.executesSuspend(owner: <ERROR CLASS>, command: SuspendingCommand<S>): T
fun <S, T> <ERROR CLASS><S, T>.executesSuspend(owner: <ERROR CLASS>, command: SuspendingCommand<S>): T

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

launch
Link copied to clipboard
fun <ERROR CLASS>.launch(context: CoroutineContext = minecraftDispatcher, start: <ERROR CLASS> = CoroutineStart.DEFAULT, block: suspend <ERROR CLASS>.() -> Unit): <ERROR CLASS>
fun <ERROR CLASS>.launch(context: CoroutineContext = minecraftDispatcher, start: <ERROR CLASS> = CoroutineStart.DEFAULT, block: suspend <ERROR CLASS>.() -> Unit): <ERROR CLASS>
fun <ERROR CLASS>.launch(context: CoroutineContext = minecraftDispatcher, start: <ERROR CLASS> = CoroutineStart.DEFAULT, block: suspend <ERROR CLASS>.() -> Unit): <ERROR 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.

Properties

mcCoroutineConfiguration
Link copied to clipboard
val <ERROR CLASS>.mcCoroutineConfiguration: MCCoroutineConfiguration

Gets the configuration instance of MCCoroutine.

mcCoroutineConfiguration
Link copied to clipboard
val <ERROR CLASS>.mcCoroutineConfiguration: MCCoroutineConfiguration

Gets the configuration instance of MCCoroutine.

mcCoroutineConfiguration
Link copied to clipboard
val <ERROR CLASS>.mcCoroutineConfiguration: MCCoroutineConfiguration

Gets the configuration instance of MCCoroutine.

minecraftDispatcher
Link copied to clipboard
val <ERROR CLASS>.minecraftDispatcher: CoroutineContext

Gets the extension minecraft dispatcher.

minecraftDispatcher
Link copied to clipboard
val <ERROR CLASS>.minecraftDispatcher: CoroutineContext

Gets the extension minecraft dispatcher.

minecraftDispatcher
Link copied to clipboard
val <ERROR CLASS>.minecraftDispatcher: CoroutineContext

Gets the extension minecraft dispatcher.

scope
Link copied to clipboard
val <ERROR CLASS>.scope: <ERROR CLASS>

Gets the coroutine scope.

scope
Link copied to clipboard
val <ERROR CLASS>.scope: <ERROR CLASS>

Gets the coroutine scope.

scope
Link copied to clipboard
val <ERROR CLASS>.scope: <ERROR CLASS>

Gets the coroutine scope.

ticks
Link copied to clipboard
val Int.ticks: Long

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.