From 973c13e84f8e091a6a920779103d96559dcd32a8 Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 27 Aug 2022 01:38:49 +0200 Subject: Switch to yarn mappings --- src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt') 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 +} -- cgit