diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 15 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt | 9 |
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 + } } |