Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Crystal Nucleus Tracker, Profit-Per, and Filter #2285

Merged
merged 137 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
f3ae2ba
WIP, profit per functional
DavidArthurCole Aug 1, 2024
2bcc322
Ignore both powders
DavidArthurCole Aug 1, 2024
f3a9090
Cleanup
DavidArthurCole Aug 1, 2024
65592d1
Progress on tracker, rework API
DavidArthurCole Aug 1, 2024
7a5690e
Sto progress
DavidArthurCole Aug 2, 2024
0e08e6d
Everything except chat filter done
DavidArthurCole Aug 2, 2024
81438a7
All features functional
DavidArthurCole Aug 2, 2024
88d134c
Update end pattern and formatting
DavidArthurCole Aug 2, 2024
16d68da
Add key and robot parts to tracker
DavidArthurCole Aug 2, 2024
a96ffa8
Formatting
DavidArthurCole Aug 2, 2024
a79e4d6
last formatting one
DavidArthurCole Aug 2, 2024
91c56c5
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 2, 2024
eab8c9d
More formattin'
DavidArthurCole Aug 4, 2024
ed86bfc
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 17, 2024
a1e33a3
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 21, 2024
06ecb91
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 26, 2024
4ed59d7
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 26, 2024
7777d8b
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Aug 26, 2024
648de97
Merge branch 'beta' into NucleusTracker
DavidArthurCole Aug 26, 2024
5c9f09e
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Sep 9, 2024
286ca36
Update tracker to use Searchables, new syntaxes
DavidArthurCole Sep 9, 2024
7c1d3ad
Merge branch 'beta' into NucleusTracker
DavidArthurCole Sep 10, 2024
7535849
Merge branch 'beta' into NucleusTracker
CalMWolfs Sep 11, 2024
b54cac1
Merge branch 'beta' into NucleusTracker
DavidArthurCole Sep 13, 2024
800905d
I'm not even sure how that one happened
DavidArthurCole Sep 13, 2024
444b8df
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Sep 14, 2024
0489e23
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Sep 25, 2024
1e72010
Merge branch 'beta' into NucleusTracker
DavidArthurCole Sep 26, 2024
7bebac1
Merge branch 'beta' into NucleusTracker
DavidArthurCole Sep 30, 2024
41cd33a
merge
DavidArthurCole Sep 30, 2024
f472ed4
Address TODO
DavidArthurCole Sep 30, 2024
ec451df
Merge branch 'beta' into NucleusTracker
DavidArthurCole Oct 3, 2024
88bc64f
Merge branch 'beta' into NucleusTracker
DavidArthurCole Oct 13, 2024
fdfec98
Fixes & improvements
DavidArthurCole Oct 16, 2024
fc4cb8c
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Oct 20, 2024
db21260
Fix detektions
DavidArthurCole Oct 20, 2024
fa2a9dd
Autoformat will be the death of me
DavidArthurCole Oct 20, 2024
dcb8778
Merge branch 'beta' into NucleusTracker
CalMWolfs Oct 20, 2024
161d720
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Oct 24, 2024
89a5f70
Fixes for books?
DavidArthurCole Oct 24, 2024
b6c51b7
Please...
DavidArthurCole Oct 24, 2024
a529efc
Detektions
DavidArthurCole Oct 24, 2024
b5149b4
Fixes
DavidArthurCole Oct 24, 2024
af2b0c1
Fix color code
DavidArthurCole Oct 24, 2024
55ae3f9
And one more improvement
DavidArthurCole Oct 24, 2024
60d2862
Bruh
DavidArthurCole Oct 24, 2024
ccc6ca8
Yeah that needed doing ...
DavidArthurCole Oct 24, 2024
39cef60
Track bal pets
DavidArthurCole Oct 24, 2024
76268ea
Detektion and requested changes
DavidArthurCole Oct 24, 2024
0708bdb
Map InternalName to Int, fixes for profit per
DavidArthurCole Oct 24, 2024
50bb3fd
Still bugged, debug chats in-place
DavidArthurCole Oct 25, 2024
2f71513
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Oct 25, 2024
dfbaac5
6 hours of my life. Because of enchant description removal.
DavidArthurCole Oct 25, 2024
8c42ef2
Improvements
DavidArthurCole Oct 25, 2024
a98d004
Formatting
DavidArthurCole Oct 25, 2024
31f2a7c
Detektions
DavidArthurCole Oct 25, 2024
9b1ecc2
It would help if I sent the chat.
DavidArthurCole Oct 25, 2024
ec4bfb0
Better enchant detection and slightly better error logging
VixidDev Oct 25, 2024
e3bef56
Merge branch 'vixid-enchant-fix' into NucleusTracker
DavidArthurCole Oct 25, 2024
e569b42
Forward merge vixid's enchant replacer fixes
DavidArthurCole Oct 25, 2024
43aafd4
bruh
DavidArthurCole Oct 25, 2024
acc4cc3
Remove 'fix', formatting
DavidArthurCole Oct 25, 2024
7f2751c
Merge branch 'beta' into NucleusTracker
DavidArthurCole Oct 27, 2024
f5ec1c8
Rollback
DavidArthurCole Oct 27, 2024
e99933e
Add more blocked patterns
DavidArthurCole Oct 29, 2024
f6ae650
Fixes for missing strings, formatting of code, replace deprecations
DavidArthurCole Oct 30, 2024
3355f28
Fix patterns
DavidArthurCole Nov 19, 2024
0cbd5b0
Detekt
DavidArthurCole Nov 20, 2024
9296beb
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Nov 29, 2024
7bdccec
Merge branch 'beta' into NucleusTracker
DavidArthurCole Dec 4, 2024
9949df6
Merge branch 'beta' into NucleusTracker
CalMWolfs Dec 6, 2024
d3681b9
Merge remote-tracking branch 'upstream/beta' into NucleusTracker
DavidArthurCole Dec 10, 2024
47e944a
Merge
DavidArthurCole Dec 10, 2024
8877271
Merge remote-tracking branch 'upstream/beta' into NucleusTracker
DavidArthurCole Dec 10, 2024
a9615ad
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Dec 13, 2024
78630f1
Merge branch 'beta' into NucleusTracker
CalMWolfs Dec 14, 2024
4b5feba
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Dec 16, 2024
5f47e33
Merge branch 'hannibal002:beta' into NucleusTracker
DavidArthurCole Dec 20, 2024
f390ae6
Merge remote-tracking branch 'upstream/beta' into NucleusTracker
DavidArthurCole Jan 2, 2025
e7a46fc
Add option for tracking by robot parts or apparatuses
DavidArthurCole Jan 2, 2025
745b18a
Detekt
DavidArthurCole Jan 2, 2025
673a655
Fix formatting
DavidArthurCole Jan 2, 2025
ca8a86a
Formatting
DavidArthurCole Jan 2, 2025
3519b10
Update on update
DavidArthurCole Jan 2, 2025
2dd56d6
Fix
DavidArthurCole Jan 2, 2025
9e35c7a
Merge
DavidArthurCole Jan 4, 2025
3385af0
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/NucleusTracker
CalMWolfs Jan 8, 2025
3d36e43
Merge cleanup
DavidArthurCole Jan 8, 2025
f417be3
Merge remote-tracking branch 'upstream/beta' into NucleusTracker
DavidArthurCole Jan 9, 2025
3177d0e
Sto
DavidArthurCole Jan 9, 2025
7aa6a42
Fuck off detekt
DavidArthurCole Jan 9, 2025
b29a4ac
Cleanup
DavidArthurCole Jan 9, 2025
807f7ff
Merge
DavidArthurCole Jan 9, 2025
2fc28a0
Cleanup part 2
DavidArthurCole Jan 9, 2025
ceddbb2
Merge remote-tracking branch 'upstream/beta' into NucleusTracker
DavidArthurCole Jan 9, 2025
1531530
trailing commas
CalMWolfs Jan 9, 2025
6d0f233
Merge branch 'beta' into NucleusTracker
CalMWolfs Jan 10, 2025
158f868
Couple list fixes
DavidArthurCole Jan 10, 2025
663edc7
Regression
DavidArthurCole Jan 10, 2025
79c54ce
Merge branch 'beta' into NucleusTracker
CalMWolfs Jan 12, 2025
33e9243
regression
CalMWolfs Jan 12, 2025
0fd27f6
Merge branch 'beta' into NucleusTracker
DavidArthurCole Jan 14, 2025
1b256e9
fix
DavidArthurCole Jan 15, 2025
3dc1db8
Merge branch 'beta' into NucleusTracker
CalMWolfs Jan 16, 2025
bf3c936
Backend: Disable hoppity call warning by default (#3241)
Chissl Jan 17, 2025
8e5e054
Fix: Dance room helper hide players (#3244)
CalMWolfs Jan 18, 2025
5d3d9c5
Fix: Show Town Board for accepted Fetch quest (#3233)
lunaynx Jan 18, 2025
10afe90
Improvement: Improve text for when fewer than 10 levels remain on HOT…
Nessiesson Jan 18, 2025
e60ef86
Backend: removing the download source checker (#3246)
hannibal002 Jan 18, 2025
fd900e8
Fix: FAQ formatting (#3232)
ItsEmpa Jan 18, 2025
9ab1602
Feature: Shorten Coin Amounts in Chat (#3231)
DavidArthurCole Jan 18, 2025
177e856
Fix: GUI Editor + GUI Search (#3226)
hannibal002 Jan 18, 2025
9c176c5
Backend: /shdebug + ram + uptime (#3209)
hannibal002 Jan 18, 2025
0dfe5f2
Improvement: Better GUI rendering (#3218)
hannibal002 Jan 18, 2025
a471180
Fix: Experimentation Table (2x) (#3239)
hannibal002 Jan 18, 2025
a34d242
Merge branch 'beta' into NucleusTracker
DavidArthurCole Jan 19, 2025
6d8a757
Merge remote-tracking branch 'upstream' into NucleusTracker
DavidArthurCole Jan 20, 2025
19d1b36
Merge branch 'beta' into NucleusTracker
CalMWolfs Jan 22, 2025
e38b1d5
Merge branch 'beta' into NucleusTracker
CalMWolfs Jan 24, 2025
140d58f
Merge
DavidArthurCole Jan 24, 2025
5199e2e
Fix
DavidArthurCole Jan 24, 2025
44cdfd4
Merge branch 'beta' into NucleusTracker
DavidArthurCole Jan 24, 2025
b656c41
DetekT
DavidArthurCole Jan 24, 2025
561377e
DetektTTTTTT
DavidArthurCole Jan 24, 2025
a732368
Merge branch 'refs/heads/beta' into fork/DavidArthurCole/NucleusTracker
hannibal002 Jan 24, 2025
933e612
add info if empty
hannibal002 Jan 24, 2025
b2e0690
code cleanup
hannibal002 Jan 24, 2025
9666131
removing cf check, making the display gray in any other menu
hannibal002 Jan 24, 2025
55e2894
formatting
hannibal002 Jan 24, 2025
55cf8c7
Merge branch 'beta' into NucleusTracker
DavidArthurCole Jan 24, 2025
cd79462
using RenderDisplayHelper for all trackers
hannibal002 Jan 24, 2025
b44de11
using tracker.initRenderer
hannibal002 Jan 24, 2025
00c8eaf
Merge
DavidArthurCole Jan 25, 2025
2dfbfd6
Merge branch 'beta' into NucleusTracker
DavidArthurCole Jan 25, 2025
6d00af4
Cleanup
DavidArthurCole Jan 25, 2025
2e96306
Bruh
DavidArthurCole Jan 25, 2025
4254a74
Formatting
DavidArthurCole Jan 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package at.hannibal2.skyhanni.config.features.chat

import at.hannibal2.skyhanni.config.FeatureToggle
import com.google.gson.annotations.Expose
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption
import java.util.*

class CrystalNucleusConfig {
@Expose
@ConfigOption(
name = "Enabled",
desc = "Hide or compact messages relating to Crystal Nucleus runs in the Crystal Hollows.",
)
@ConfigEditorBoolean
@FeatureToggle
var enabled: Boolean = false

enum class CrystalNucleusMessageTypes(val displayName: String) {
RUN_COMPLETED("§5Run Completed Summary"),
CRYSTAL_COLLECTED("§aC§6r§dy§bs§et§aa§6l §7Collected"),
CRYSTAL_PLACED("§aC§6r§dy§bs§et§aa§6l §7Placed"),
NPC_DIVAN_KEEPERS("§e[NPC] §6Keepers §7(§2Mines of Divan§7)"),
NPC_PROF_ROBOT("§e[NPC] Professor Robot"),
NPC_KING_YOLKAR("§e[NPC] §6King Yolkar"),
NPC_GOBLIN_GUARDS("§c[GUARD]§7s (§6Goblin Den§7)"),
NON_TOOL_SCAVENGE("§7Non-Tool §cMetal Detector §7loot");

override fun toString() = displayName
}

@Expose
@ConfigOption(
name = "Modified Messages",
desc = "Messages that should be hidden or compacted.\n§cImportant information will still appear§7.",
)
@ConfigEditorDraggableList
var modifiedMessages: List<CrystalNucleusMessageTypes> = mutableListOf(
CrystalNucleusMessageTypes.CRYSTAL_COLLECTED,
CrystalNucleusMessageTypes.CRYSTAL_PLACED,
CrystalNucleusMessageTypes.RUN_COMPLETED,
CrystalNucleusMessageTypes.NPC_DIVAN_KEEPERS,
CrystalNucleusMessageTypes.NPC_PROF_ROBOT,
CrystalNucleusMessageTypes.NPC_KING_YOLKAR,
CrystalNucleusMessageTypes.NPC_GOBLIN_GUARDS,
CrystalNucleusMessageTypes.NON_TOOL_SCAVENGE,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ class FilterTypesConfig {
@Expose
@ConfigOption(name = "Powder Mining", desc = "")
@Accordion
var powderMiningFilter: PowderMiningFilterConfig = PowderMiningFilterConfig()
var powderMining: PowderMiningConfig = PowderMiningConfig()

@Expose
@ConfigOption(name = "Crystal Nucleus", desc = "")
@Accordion
var crystalNucleus: CrystalNucleusConfig = CrystalNucleusConfig()

@Expose
@ConfigOption(name = "Stash Messages", desc = "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption

class PowderMiningFilterConfig {
class PowderMiningConfig {
@Expose
@ConfigOption(name = "Enabled", desc = "Hide messages while opening chests in the Crystal Hollows.")
@ConfigEditorBoolean
Expand All @@ -24,7 +24,7 @@ class PowderMiningFilterConfig {
"§c60000§7: §cHide all"
)
@ConfigEditorSlider(minValue = 0f, maxValue = 60000f, minStep = 500f)
var powderFilterThreshold: Int = 1000
var powderThreshold: Int = 1000

@Expose
@ConfigOption(
Expand All @@ -34,9 +34,9 @@ class PowderMiningFilterConfig {
"§c20§7: §cHide all"
)
@ConfigEditorSlider(minValue = 0f, maxValue = 20f, minStep = 1f)
var essenceFilterThreshold: Int = 5
var essenceThreshold: Int = 5

enum class SimplePowderMiningRewardTypes(private val displayName: String) {
enum class SimplePowderMiningRewardTypes(val displayName: String) {
ASCENSION_ROPE("§9Ascension Rope"),
WISHING_COMPASS("§aWishing Compass"),
OIL_BARREL("§aOil Barrel"),
Expand Down Expand Up @@ -68,9 +68,9 @@ class PowderMiningFilterConfig {
@Expose
@ConfigOption(name = "Goblin Egg", desc = "Hide Goblin Egg rewards that are below a certain rarity.")
@ConfigEditorDropdown
var goblinEggs: GoblinEggFilterEntry = GoblinEggFilterEntry.YELLOW_UP
var goblinEggs: GoblinEggEntry = GoblinEggEntry.YELLOW_UP

enum class GoblinEggFilterEntry(private val displayName: String) {
enum class GoblinEggEntry(val displayName: String) {
SHOW_ALL("Show all"),
HIDE_ALL("Hide all"),
GREEN_UP("Show §aGreen §7and up"),
Expand All @@ -81,9 +81,8 @@ class PowderMiningFilterConfig {
override fun toString() = displayName
}

// TODO rename to "gemstoneFilter" (addressed in #2285)
@Expose
@ConfigOption(name = "Gemstones", desc = "")
@Accordion
var gemstoneFilterConfig: PowderMiningGemstoneFilterConfig = PowderMiningGemstoneFilterConfig()
var gemstone: PowderMiningGemstoneConfig = PowderMiningGemstoneConfig()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption

class PowderMiningGemstoneFilterConfig {
class PowderMiningGemstoneConfig {
@Expose
@ConfigOption(name = "Stronger Tool Messages", desc = "Hide 'You need a stronger tool..' messages.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import at.hannibal2.skyhanni.config.features.mining.glacite.TunnelMapsConfig;
import at.hannibal2.skyhanni.config.features.mining.nucleus.AreaWallsConfig;
import at.hannibal2.skyhanni.config.features.mining.nucleus.CrystalHighlighterConfig;
import at.hannibal2.skyhanni.config.features.mining.nucleus.CrystalNucleusTrackerConfig;
import at.hannibal2.skyhanni.config.features.mining.nucleus.PowderTrackerConfig;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
Expand Down Expand Up @@ -49,6 +50,11 @@ public class MiningConfig {
@Accordion
public AreaWallsConfig crystalHollowsAreaWalls = new AreaWallsConfig();

@Expose
@ConfigOption(name = "Crystal Nucleus Tracker", desc = "")
@Accordion
public CrystalNucleusTrackerConfig crystalNucleusTracker = new CrystalNucleusTrackerConfig();

@Expose
@ConfigOption(name = "Cold Overlay", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package at.hannibal2.skyhanni.config.features.mining.nucleus

import at.hannibal2.skyhanni.config.FeatureToggle
import at.hannibal2.skyhanni.config.core.config.Position
import com.google.gson.annotations.Expose
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption
import io.github.notenoughupdates.moulconfig.observer.Property

class CrystalNucleusTrackerConfig {
@Expose
@ConfigOption(name = "Enabled", desc = "Enable the Crystal Nucleus Tracker overlay.")
@ConfigEditorBoolean
@FeatureToggle
var enabled: Boolean = false

@Expose
@ConfigLink(owner = CrystalNucleusTrackerConfig::class, field = "enabled")
var position: Position = Position(20, 20, false, true)

@Expose
@ConfigOption(name = "Show Outside of Nucleus", desc = "Show the tracker anywhere in the Crystal Hollows.")
@ConfigEditorBoolean
var showOutsideNucleus: Boolean = false

@Expose
@ConfigOption(name = "Profit Per", desc = "Show profit summary message for the completed nucleus run.")
@ConfigEditorBoolean
var profitPer: Boolean = true

@Expose
@ConfigOption(
name = "Profit Per Minimum",
desc = "Only show items above this coin amount in the summary message hover.",
)
@ConfigEditorSlider(minValue = 0f, maxValue = 1000000f, minStep = 5000f)
var profitPerMinimum: Int = 20000

@Expose
@ConfigOption(name = "Professor Usage", desc = "Determine how cost for Sapphire Crystal is calculated.")
@ConfigEditorDropdown
var professorUsage: Property<ProfessorUsageType> = Property.of(ProfessorUsageType.ROBOT_PARTS)

enum class ProfessorUsageType(private val displayName: String) {
ROBOT_PARTS("§9Robot Parts"),
PRECURSOR_APPARATUS("§5Precursor Apparatus"),
;

override fun toString(): String = displayName
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactor
import at.hannibal2.skyhanni.features.inventory.experimentationtable.ExperimentsProfitTracker
import at.hannibal2.skyhanni.features.inventory.wardrobe.WardrobeApi.WardrobeData
import at.hannibal2.skyhanni.features.mining.MineshaftPityDisplay.PityData
import at.hannibal2.skyhanni.features.mining.crystalhollows.CrystalNucleusTracker
import at.hannibal2.skyhanni.features.mining.fossilexcavator.ExcavatorProfitTracker
import at.hannibal2.skyhanni.features.mining.glacitemineshaft.CorpseTracker.BucketData
import at.hannibal2.skyhanni.features.mining.glacitemineshaft.CorpseTracker
import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker
import at.hannibal2.skyhanni.features.misc.DraconicSacrificeTracker
import at.hannibal2.skyhanni.features.misc.EnchantedClockHelper
Expand Down Expand Up @@ -600,8 +601,11 @@ class ProfileSpecificStorage {
var blocksBroken: MutableList<PityData> = mutableListOf()

@Expose
var corpseProfitTracker: BucketData = BucketData()
var corpseProfitTracker: CorpseTracker.BucketData = CorpseTracker.BucketData()
}

@Expose
var crystalNucleusTracker: CrystalNucleusTracker.Data = CrystalNucleusTracker.Data()
}

@Expose
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package at.hannibal2.skyhanni.events.mining

import at.hannibal2.skyhanni.api.event.SkyHanniEvent
import at.hannibal2.skyhanni.utils.NeuInternalName

class CrystalNucleusLootEvent(val loot: Map<NeuInternalName, Int>) : SkyHanniEvent()
19 changes: 18 additions & 1 deletion src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ object ChatFilter {
@HandleEvent
fun onChat(event: SkyHanniChatEvent) {
var blockReason = block(event.message)
if (blockReason == null && config.powderMiningFilter.enabled) blockReason = powderMiningBlock(event)
if (blockReason == null && config.powderMining.enabled) blockReason = powderMiningBlock(event)
if (blockReason == null && config.crystalNucleus.enabled) blockReason = crystalNucleusBlock(event)

event.blockedReason = blockReason ?: return
}
Expand Down Expand Up @@ -587,6 +588,20 @@ object ChatFilter {
return powderMiningMatchResult
}

/**
* Checks if the message is a blocked Crystal Nucleus Run message, as defined in CrystalNucleusChatFilter.
* Will conditionally modify/compact messages in some cases, or return a blocking code
* @param event The event to check
* @return Block reason if applicable
* @see block
*/
private fun crystalNucleusBlock(event: SkyHanniChatEvent): String? {
val (blockCode, newMessage) = CrystalNucleusChatFilter.block(event.message)?.getPair() ?: Pair(null, null)
newMessage?.let { event.chatComponent = ChatComponentText(it) }
blockCode?.let { return it }
return null
}

private var othersMsg: String? = null

/**
Expand Down Expand Up @@ -651,5 +666,7 @@ object ChatFilter {
}
}
}
event.move(61, "chat.filterType.powderMiningFilter", "chat.filterType.powderMining")
event.move(61, "chat.filterType.gemstoneFilterConfig", "chat.filterType.powderMining.gemstone")
}
}
Loading
Loading