aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-08-27 01:38:49 +0200
committernea <romangraef@gmail.com>2022-08-27 01:38:49 +0200
commit973c13e84f8e091a6a920779103d96559dcd32a8 (patch)
tree95741faaa85509216a3a5130a3d8cd48b1b415fd /src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt
parent4c7bd601c4df4d03536e97e18e4b88d858330ad9 (diff)
downloadfirmament-973c13e84f8e091a6a920779103d96559dcd32a8.tar.gz
firmament-973c13e84f8e091a6a920779103d96559dcd32a8.tar.bz2
firmament-973c13e84f8e091a6a920779103d96559dcd32a8.zip
Switch to yarn mappings
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt
index 95dc982..6c86c41 100644
--- a/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt
+++ b/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt
@@ -2,19 +2,19 @@ package moe.nea.notenoughupdates.util
import moe.nea.notenoughupdates.NotEnoughUpdates
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
-import net.minecraft.client.Minecraft
-import net.minecraft.client.gui.screens.Screen
+import net.minecraft.client.MinecraftClient
+import net.minecraft.client.gui.screen.Screen
object ScreenUtil {
init {
ClientTickEvents.START_CLIENT_TICK.register(::onTick)
}
- private fun onTick(minecraft: Minecraft) {
+ private fun onTick(minecraft: MinecraftClient) {
if (nextOpenedGui != null) {
val p = minecraft.player
- if (p?.containerMenu != null) {
- p.closeContainer()
+ if (p?.currentScreenHandler != null) {
+ p.closeHandledScreen()
}
minecraft.setScreen(nextOpenedGui)
nextOpenedGui = null
@@ -33,4 +33,4 @@ object ScreenUtil {
}
-} \ No newline at end of file
+}