aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-07 04:58:27 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-07 04:58:27 +0100
commitcdfec7e6849c3a807812515eef26582933fbadd8 (patch)
treeefec8ea354a208895885b20db865524fea59191f /src/main/java/at/hannibal2/skyhanni/utils
parent892429f7a1d3f433a759765b8d6e4d437ffd9899 (diff)
downloadskyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.tar.gz
skyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.tar.bz2
skyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.zip
Fixed error in Sea Creature Guide inventory.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index 1d51d1be9..f1f107e2f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -32,4 +32,15 @@ object InventoryUtils {
}
return list
}
+
+ fun openInventoryName(): String {
+ val guiChest = Minecraft.getMinecraft().currentScreen
+ val chestName = if (guiChest is GuiChest) {
+ val chest = guiChest.inventorySlots as ContainerChest
+ chest.lowerChestInventory.displayName.unformattedText.trim()
+ } else {
+ ""
+ }
+ return chestName
+ }
} \ No newline at end of file