aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-07 06:02:52 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-07 06:02:52 +0100
commit6b253a8ac2cdb03a67f111725c263dd84532f989 (patch)
treea9e7752725ca8dbfb7e1009e18c7ee0d3d283ca8 /src/main/java
parent2b78f5b11d480c632b4a5d5b4a4a8f659d8d3ea7 (diff)
downloadskyhanni-6b253a8ac2cdb03a67f111725c263dd84532f989.tar.gz
skyhanni-6b253a8ac2cdb03a67f111725c263dd84532f989.tar.bz2
skyhanni-6b253a8ac2cdb03a67f111725c263dd84532f989.zip
Fixed crash.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
index a72466a66..afdc446f9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
@@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import com.google.gson.JsonObject
+import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.inventory.ContainerChest
import net.minecraft.item.ItemStack
@@ -92,7 +93,10 @@ class HideNotClickableItems {
fun onTooltip(event: ItemTooltipEvent) {
if (isDisabled()) return
if (event.toolTip == null) return
- val chestName = InventoryUtils.openInventoryName()
+
+ val guiChest = Minecraft.getMinecraft().currentScreen
+ if (guiChest !is GuiChest) return
+ val chestName = (guiChest.inventorySlots as ContainerChest).getInventoryName()
val stack = event.itemStack
if (InventoryUtils.getItemsInOpenChest().map { it.stack }.contains(stack)) return