aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util/MC.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-26 18:04:45 +0200
committerLinnea Gräf <nea@nea.moe>2024-04-26 18:15:54 +0200
commit7e0151569477df63601be50c82177ecfd21e5deb (patch)
treef30e5440a1855de92d2b424ef79339d3d6cf5f34 /src/main/kotlin/moe/nea/firmament/util/MC.kt
parent041da7c7d179df01c4048a81ddf40a9f13c3ce77 (diff)
downloadfirmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.gz
firmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.bz2
firmament-7e0151569477df63601be50c82177ecfd21e5deb.zip
Bump to 1.20.5
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/MC.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/MC.kt13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/MC.kt b/src/main/kotlin/moe/nea/firmament/util/MC.kt
index 5c4bf5c..2fb1c75 100644
--- a/src/main/kotlin/moe/nea/firmament/util/MC.kt
+++ b/src/main/kotlin/moe/nea/firmament/util/MC.kt
@@ -1,5 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
@@ -7,13 +8,12 @@
package moe.nea.firmament.util
import io.github.moulberry.repo.data.Coordinate
-import java.time.Instant
import java.util.concurrent.ConcurrentLinkedQueue
import net.minecraft.client.MinecraftClient
import net.minecraft.client.gui.screen.ingame.HandledScreen
-import net.minecraft.network.message.ArgumentSignatureDataMap
-import net.minecraft.network.message.LastSeenMessagesCollector.LastSeenMessages
import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket
+import net.minecraft.registry.BuiltinRegistries
+import net.minecraft.registry.RegistryWrapper
import net.minecraft.resource.ReloadableResourceManagerImpl
import net.minecraft.text.Text
import net.minecraft.util.math.BlockPos
@@ -40,14 +40,9 @@ object MC {
fun sendServerCommand(command: String) {
val nh = player?.networkHandler ?: return
- val lastSeenMessages: LastSeenMessages = nh.lastSeenMessagesCollector.collect()
nh.sendPacket(
CommandExecutionC2SPacket(
command,
- Instant.now(),
- 0L,
- ArgumentSignatureDataMap.EMPTY,
- lastSeenMessages.update()
)
)
}
@@ -77,6 +72,8 @@ object MC {
set(value) = MinecraftClient.getInstance().setScreen(value)
inline val handledScreen: HandledScreen<*>? get() = MinecraftClient.getInstance().currentScreen as? HandledScreen<*>
inline val window get() = MinecraftClient.getInstance().window
+ inline val currentRegistries: RegistryWrapper.WrapperLookup? get() = world?.registryManager
+ val defaultRegistries: RegistryWrapper.WrapperLookup = BuiltinRegistries.createWrapperLookup()
}