From 3b22cc895f83720554ba0983872a9567ebcee7c5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 18 May 2023 17:13:47 +0200 Subject: Fixed crash when opening minion inventory --- .../java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 887b17a2a..69beaa303 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -20,6 +20,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import net.minecraft.client.Minecraft +import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.GuiScreenEvent @@ -147,10 +148,10 @@ class MinionFeatures { fun onTick(event: TickEvent.ClientTickEvent) { if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return - if (config.hopperProfitDisplay) { - coinsPerDay = if (minionInventoryOpen) { - updateCoinsPerDay() - } else "" + if (Minecraft.getMinecraft().currentScreen is GuiChest) { + if (config.hopperProfitDisplay) { + coinsPerDay = if (minionInventoryOpen) updateCoinsPerDay() else "" + } } } -- cgit