diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt | 12 |
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 +} |