summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-04-17 15:21:17 +0200
committerGitHub <noreply@github.com>2024-04-17 15:21:17 +0200
commita99499ab99aee3e827cd77de50ec07ab81c0baf5 (patch)
tree71c312b4b2b228a41f80f625501eeded9f1852bb /src/main/java/at/hannibal2/skyhanni/features/mining
parent202512d5f171754613f734b649aa24644b578d06 (diff)
downloadskyhanni-a99499ab99aee3e827cd77de50ec07ab81c0baf5.tar.gz
skyhanni-a99499ab99aee3e827cd77de50ec07ab81c0baf5.tar.bz2
skyhanni-a99499ab99aee3e827cd77de50ec07ab81c0baf5.zip
Feature: Glacite Powder as stack size in Fossil Excavator (#1458)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt
new file mode 100644
index 000000000..18418f959
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/GlacitePowderFeatures.kt
@@ -0,0 +1,33 @@
+package at.hannibal2.skyhanni.features.mining.fossilexcavator
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.RenderItemTipEvent
+import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
+import at.hannibal2.skyhanni.utils.NumberUtil
+import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class GlacitePowderFeatures {
+ private val config get() = SkyHanniMod.feature.mining.fossilExcavator
+
+ private val patternGroup = RepoPattern.group("inventory.item.overlay")
+
+ private val glacitePowderPattern by patternGroup.pattern(
+ "glacitepowder",
+ "Glacite Powder x(?<amount>.*)"
+ )
+
+ @SubscribeEvent
+ fun onRenderItemTip(event: RenderItemTipEvent) {
+ if (!isEnabled()) return
+
+ glacitePowderPattern.matchMatcher(event.stack.cleanName()) {
+ val powder = group("amount").formatLong()
+ event.stackTip = "§b${NumberUtil.format(powder)}"
+ }
+ }
+
+ fun isEnabled() = FossilExcavatorAPI.inInventory && config.glacitePowderStack
+}