aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 17:42:15 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 17:42:15 +0100
commit12d9bcc957febaf1ebd521a38fe0f6a592472f9d (patch)
tree6026344e81d980892228595fe08a72aaf1d6359e /src/main/java/at/hannibal2
parent8615ad039d3d2213088afc67ca6491fff0d31cad (diff)
downloadskyhanni-12d9bcc957febaf1ebd521a38fe0f6a592472f9d.tar.gz
skyhanni-12d9bcc957febaf1ebd521a38fe0f6a592472f9d.tar.bz2
skyhanni-12d9bcc957febaf1ebd521a38fe0f6a592472f9d.zip
Fixed Estimated Item Value getting shown in pet rule creation wardrobe slot pick menu.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt9
2 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
index bfdd876c3..cefac74a8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
@@ -141,11 +141,6 @@ object EstimatedItemValue {
}
}
- // Stats Breakdown
- val name = item.name ?: return
- if (name == "§6☘ Category: Item Ability (Passive)") return
- if (name.contains("Salesperson")) return
-
val newDisplay = try {
draw(item)
} catch (e: Exception) {
@@ -162,6 +157,16 @@ object EstimatedItemValue {
private fun draw(stack: ItemStack): List<List<Any>> {
val internalName = stack.getInternalNameOrNull() ?: return listOf()
+ // Stats Breakdown
+ val name = stack.name ?: return listOf()
+ if (name == "§6☘ Category: Item Ability (Passive)") return listOf()
+ if (name.contains("Salesperson")) return listOf()
+
+ // Autopet rule > Create Rule
+ if (!InventoryUtils.isSlotInPlayerInventory(stack)) {
+ if (InventoryUtils.openInventoryName() == "Choose a wardrobe slot") return listOf()
+ }
+
// FIX neu item list
if (internalName.startsWith("ULTIMATE_ULTIMATE_")) return listOf()
// We don't need this feature to work on books at all
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index be29569a5..9ce83c23a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -4,6 +4,8 @@ import at.hannibal2.skyhanni.test.command.ErrorManager
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
+import net.minecraft.client.gui.inventory.GuiContainer
+import net.minecraft.entity.player.InventoryPlayer
import net.minecraft.inventory.ContainerChest
import net.minecraft.inventory.Slot
import net.minecraft.item.ItemStack
@@ -45,7 +47,7 @@ object InventoryUtils {
fun inStorage() = openInventoryName().let {
(it.contains("Storage") && !it.contains("Rift Storage"))
- || it.contains("Ender Chest") || it.contains("Backpack")
+ || it.contains("Ender Chest") || it.contains("Backpack")
}
fun getItemInHand(): ItemStack? = Minecraft.getMinecraft().thePlayer.heldItem
@@ -66,4 +68,9 @@ object InventoryUtils {
false
}
}
+
+ fun isSlotInPlayerInventory(itemStack: ItemStack): Boolean {
+ val screen = Minecraft.getMinecraft().currentScreen as? GuiContainer ?: return false
+ return screen.slotUnderMouse.inventory is InventoryPlayer && screen.slotUnderMouse.stack == itemStack
+ }
}