diff options
Diffstat (limited to 'src/main/java')
3 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index e682ee675..dbca1c71d 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -273,6 +273,7 @@ import at.hannibal2.skyhanni.features.mining.eventtracker.MiningEventDisplay import at.hannibal2.skyhanni.features.mining.eventtracker.MiningEventTracker import at.hannibal2.skyhanni.features.mining.fossilexcavator.ExcavatorProfitTracker import at.hannibal2.skyhanni.features.mining.fossilexcavator.FossilExcavatorAPI +import at.hannibal2.skyhanni.features.mining.fossilexcavator.GlacitePowderFeatures import at.hannibal2.skyhanni.features.mining.fossilexcavator.ProfitPerExcavation import at.hannibal2.skyhanni.features.mining.fossilexcavator.solver.FossilSolverDisplay import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker @@ -671,6 +672,7 @@ class SkyHanniMod { loadModule(FossilSolverDisplay) loadModule(ExcavatorProfitTracker()) loadModule(ProfitPerExcavation()) + loadModule(GlacitePowderFeatures()) loadModule(GardenOptimalSpeed()) loadModule(GardenLevelDisplay()) loadModule(FarmingWeightDisplay()) 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 43f863e94..c8eddb165 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 @@ -27,4 +27,13 @@ public class FossilExcavatorConfig { @FeatureToggle public boolean profitPerExcavation = false; + @Expose + @ConfigOption( + name = "Glacite Powder Stack", + desc = "Show Glacite Powder as stack size in the Fossil Excavator." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean glacitePowderStack = false; + } 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 +} |