aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt2
3 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
index cf4b0498e..92f6c02c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.core.config.Position
import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor
import at.hannibal2.skyhanni.events.GuiRenderEvent
+import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import io.github.moulberry.notenoughupdates.NEUOverlay
import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay
@@ -37,6 +38,7 @@ class GuiEditManager {
if (NEUOverlay.searchBarHasFocus) return
if (AuctionSearchOverlay.shouldReplace()) return
if (BazaarSearchOverlay.shouldReplace()) return
+ if (InventoryUtils.inStorage()) return
if (isInGui()) return
openGuiEditor()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index a5506bf5e..fe792b71e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -139,12 +139,11 @@ class GardenVisitorFeatures {
list.add(Renderable.optionalLink("$name ยง8x${amount.addSeparators()}", {
if (Minecraft.getMinecraft().currentScreen is GuiEditSign) {
LorenzUtils.setTextIntoSign("$amount")
- } else {
+ } else if (!InventoryUtils.inStorage()) {
val thePlayer = Minecraft.getMinecraft().thePlayer
- val baseName = name.removeColor()
- thePlayer.sendChatMessage("/bz $baseName");
+ thePlayer.sendChatMessage("/bz ${name.removeColor()}");
}
- }) { GardenAPI.inGarden() })
+ }) { GardenAPI.inGarden() && InventoryUtils.inStorage() })
if (config.visitorNeedsShowPrice) {
val price = NEUItems.getPrice(internalName) * amount
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index c05b9e0cd..b343b878a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -62,4 +62,6 @@ object InventoryUtils {
fun getArmor(): Array<ItemStack?> =
Minecraft.getMinecraft().thePlayer.inventory.armorInventory
+
+ fun inStorage() = openInventoryName().let { it.contains("Storage") || it.contains("Ender Chest") || it.contains("Backpack") }
} \ No newline at end of file