aboutsummaryrefslogtreecommitdiff
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
parent892429f7a1d3f433a759765b8d6e4d437ffd9899 (diff)
downloadskyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.tar.gz
skyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.tar.bz2
skyhanni-cdfec7e6849c3a807812515eef26582933fbadd8.zip
Fixed error in Sea Creature Guide inventory.
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt11
3 files changed, 21 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 72210d27a..e8b1e9f92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,7 +12,8 @@
+ Do no longer prevent the selling of bazaar items to NPC when on ironman, stranded or bingo mode.
### Fixes
-+ Dungeon level color fixed wrong colors.
++ Fixed wrong dungeon level colors. (in Party Finder)
++ Fixed error in Sea Creature Guide inventory.
## Version 0.13
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
index 4e25e3c83..bc79fdbc5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.inventory
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.RenderItemTipEvent
+import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
@@ -61,10 +62,13 @@ class ItemDisplayOverlayFeatures {
}
if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(4)) {
- if (ItemUtils.isPet(name)) {
- val level = name.between("Lvl ", "] ").toInt()
- if (level != ItemUtils.maxPetLevel(name)) {
- return "$level"
+ val chestName = InventoryUtils.openInventoryName()
+ if (!chestName.endsWith("Sea Creature Guide")) {
+ if (ItemUtils.isPet(name)) {
+ val level = name.between("Lvl ", "] ").toInt()
+ if (level != ItemUtils.maxPetLevel(name)) {
+ return "$level"
+ }
}
}
}
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