diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-30 09:26:26 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-30 09:26:26 +0200 |
commit | 409fca56ba79f3ff4c4ed51c2a8361dbc1ffd296 (patch) | |
tree | 7b19837314dd20e80f5b42c3c0822923bc4951a9 /src/main/java | |
parent | 509658c655e570a6c2db04eaecdcec4403e13f39 (diff) | |
download | skyhanni-409fca56ba79f3ff4c4ed51c2a8361dbc1ffd296.tar.gz skyhanni-409fca56ba79f3ff4c4ed51c2a8361dbc1ffd296.tar.bz2 skyhanni-409fca56ba79f3ff4c4ed51c2a8361dbc1ffd296.zip |
Fixed NEU Heavy Pearl detection.
Diffstat (limited to 'src/main/java')
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 + +} |