diff options
Diffstat (limited to 'src/main')
3 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 30c310110..f3ef5b0fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -168,6 +168,7 @@ import at.hannibal2.skyhanni.features.misc.CurrentPetDisplay import at.hannibal2.skyhanni.features.misc.CustomTextBox import at.hannibal2.skyhanni.features.misc.EnderNodeTracker import at.hannibal2.skyhanni.features.misc.ExpOrbsOnGroundHider +import at.hannibal2.skyhanni.features.misc.FixNEUHeavyPearls import at.hannibal2.skyhanni.features.misc.FrozenTreasureTracker import at.hannibal2.skyhanni.features.misc.HarpFeatures import at.hannibal2.skyhanni.features.misc.HideArmor @@ -570,6 +571,7 @@ class SkyHanniMod { loadModule(GlowingDroppedItems()) loadModule(DungeonTeammateOutlines()) loadModule(DungeonRankTabListColor()) + loadModule(FixNEUHeavyPearls()) init() diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 53914713e..9ba4c0f40 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -633,5 +633,11 @@ public class MiscConfig { public boolean superpairsClicksAlert = false; @Expose + @ConfigOption(name = "NEU Heavy Pearls", desc = "Fixing NEU Heavy Pearl detection.") + @ConfigEditorBoolean + @FeatureToggle + public boolean fixNeuHeavyPearls = true; + + @Expose public Position inventoryLoadPos = new Position(394, 124, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt new file mode 100644 index 000000000..1608bb147 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt @@ -0,0 +1,29 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.SackChangeEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import io.github.moulberry.notenoughupdates.NotEnoughUpdates +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class FixNEUHeavyPearls { + private val config get() = SkyHanniMod.feature.misc + private val heavyPearl = "HEAVY_PEARL".asInternalName() + + @SubscribeEvent + fun onSackChange(event: SackChangeEvent) { + if (!isEnabled()) return + + for (change in event.sackChanges) { + if (change.internalName == heavyPearl && change.delta == 3) { + LorenzUtils.chat("§e[SkyHanni] Mark NEU Heavy Pearls as done.") + NotEnoughUpdates.INSTANCE.config.getProfileSpecific().dailyHeavyPearlCompleted = + System.currentTimeMillis() + } + } + } + + fun isEnabled() = LorenzUtils.inSkyBlock && config.fixNeuHeavyPearls + +} |