From 8c5570bfe6ab93855e24e6924fac1105fe8342ff Mon Sep 17 00:00:00 2001 From: nea Date: Tue, 15 Aug 2023 19:34:56 +0200 Subject: Add ursa client --- src/main/kotlin/moe/nea/firmament/commands/dsl.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/moe/nea/firmament/commands/dsl.kt') diff --git a/src/main/kotlin/moe/nea/firmament/commands/dsl.kt b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt index 01a3458..d6eaf85 100644 --- a/src/main/kotlin/moe/nea/firmament/commands/dsl.kt +++ b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt @@ -16,6 +16,9 @@ import java.lang.reflect.ParameterizedType import java.lang.reflect.Type import java.lang.reflect.TypeVariable import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource +import kotlinx.coroutines.launch +import moe.nea.firmament.Firmament +import moe.nea.firmament.util.MinecraftDispatcher import moe.nea.firmament.util.iterate @@ -105,9 +108,11 @@ fun > T.thenLiteral( fun > T.then(node: ArgumentBuilder, block: T.() -> Unit): T = then(node).also(block) -fun > T.thenExecute(block: CommandContext.() -> Unit): T = +fun > T.thenExecute(block: suspend CommandContext.() -> Unit): T = executes { - block(it) + Firmament.coroutineScope.launch(MinecraftDispatcher) { + block(it) + } 1 } -- cgit