aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/Firmament.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
commitc93a04a001b0f66b2724d46b04b6d1ed49a08d07 (patch)
tree5869ca70acc482ef0362f27785c3d3f1cbb9ffae /src/main/kotlin/Firmament.kt
parentaf9893b59407c69d31ebd2ed513f0396ab4d2dc9 (diff)
downloadFirmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.gz
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.bz2
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.zip
refactor: port to mojmaps
Diffstat (limited to 'src/main/kotlin/Firmament.kt')
-rw-r--r--src/main/kotlin/Firmament.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/kotlin/Firmament.kt b/src/main/kotlin/Firmament.kt
index e707667..72f386d 100644
--- a/src/main/kotlin/Firmament.kt
+++ b/src/main/kotlin/Firmament.kt
@@ -27,8 +27,8 @@ import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import kotlin.coroutines.EmptyCoroutineContext
-import net.minecraft.command.CommandRegistryAccess
-import net.minecraft.util.Identifier
+import net.minecraft.commands.CommandBuildContext
+import net.minecraft.resources.ResourceLocation
import moe.nea.firmament.commands.registerFirmamentCommand
import moe.nea.firmament.events.ClientInitEvent
import moe.nea.firmament.events.ClientStartedEvent
@@ -93,10 +93,10 @@ object Firmament {
private fun registerCommands(
dispatcher: CommandDispatcher<FabricClientCommandSource>,
@Suppress("UNUSED_PARAMETER")
- ctx: CommandRegistryAccess
+ ctx: CommandBuildContext
) {
registerFirmamentCommand(dispatcher, ctx)
- CommandEvent.publish(CommandEvent(dispatcher, ctx, MC.networkHandler?.commandDispatcher))
+ CommandEvent.publish(CommandEvent(dispatcher, ctx, MC.networkHandler?.commands))
}
@JvmStatic
@@ -142,7 +142,7 @@ object Firmament {
}
- fun identifier(path: String) = Identifier.of(MOD_ID, path)
+ fun identifier(path: String) = ResourceLocation.fromNamespaceAndPath(MOD_ID, path)
inline fun <reified T : Any> tryDecodeJsonFromStream(inputStream: InputStream): Result<T> {
return runCatching {
json.decodeFromStream<T>(inputStream)