aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClicks <58398364+CuzImClicks@users.noreply.github.com>2024-09-21 13:33:00 +0200
committerGitHub <noreply@github.com>2024-09-21 13:33:00 +0200
commit824716488f4c73d16458cad82bb13dd5b1008fdd (patch)
tree76798e4e711859623082beb89ac1713f162f2142
parentaca98055728de99808e5d07c4ca1aea72773e703 (diff)
downloadskyhanni-824716488f4c73d16458cad82bb13dd5b1008fdd.tar.gz
skyhanni-824716488f4c73d16458cad82bb13dd5b1008fdd.tar.bz2
skyhanni-824716488f4c73d16458cad82bb13dd5b1008fdd.zip
Feature: Excavator Tooltip Hider (#2539)
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/mining/FossilExcavatorConfig.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorTooltipHider.kt22
3 files changed, 31 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/mining/FossilExcavatorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/mining/FossilExcavatorConfig.java
index 176c8f3bd..8dfb12854 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/mining/FossilExcavatorConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/mining/FossilExcavatorConfig.java
@@ -36,4 +36,12 @@ public class FossilExcavatorConfig {
@FeatureToggle
public boolean glacitePowderStack = false;
+ @Expose
+ @ConfigOption(
+ name = "Hide Excavator Tooltips",
+ desc = "Hides tooltips of items inside of the Fossil Excavator."
+ )
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean hideExcavatorTooltips = true;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt
index 75b1d6ad3..a79a66717 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt
@@ -213,6 +213,6 @@ object HarpFeatures {
if (!config.hideMelodyTooltip) return
if (!isHarpGui(InventoryUtils.openInventoryName())) return
if (event.slot.inventory !is ContainerLocalMenu) return
- event.cancel()
+ event.cancel()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorTooltipHider.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorTooltipHider.kt
new file mode 100644
index 000000000..8b58402cd
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorTooltipHider.kt
@@ -0,0 +1,22 @@
+package at.hannibal2.skyhanni.features.mining.fossilexcavator
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.LorenzToolTipEvent
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import net.minecraft.client.player.inventory.ContainerLocalMenu
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+@SkyHanniModule
+object ExcavatorTooltipHider {
+
+ private val config get() = SkyHanniMod.feature.mining.fossilExcavator
+
+ @SubscribeEvent
+ fun onTooltip(event: LorenzToolTipEvent) {
+ if (!isEnabled()) return
+ if (event.slot.inventory !is ContainerLocalMenu) return
+ event.cancel()
+ }
+
+ fun isEnabled() = FossilExcavatorAPI.inInventory && !FossilExcavatorAPI.inExcavatorMenu && config.hideExcavatorTooltips
+}