diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-08 15:04:11 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-08 15:04:11 +0100 |
commit | 854a1f71eac59e6f8f0d1f2680124f06823b76b7 (patch) | |
tree | ee38146b0473d3cc4ae07e57f64f5c861e7f42a8 /src/main/java/at | |
parent | 7eb5b1c7f11fccbee97791745c92f6f5df4826dd (diff) | |
download | skyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.tar.gz skyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.tar.bz2 skyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.zip |
code cleanup
Diffstat (limited to 'src/main/java/at')
6 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 7db9976e8..b41b894cb 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -46,6 +46,7 @@ import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson import at.hannibal2.skyhanni.data.jsonobjects.local.KnownFeaturesJson import at.hannibal2.skyhanni.data.repo.RepoManager import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.PreInitFinishedEvent import at.hannibal2.skyhanni.features.anvil.AnvilCombineHelper import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod @@ -56,9 +57,6 @@ import at.hannibal2.skyhanni.features.bingo.BingoAPI import at.hannibal2.skyhanni.features.bingo.CompactBingoChat import at.hannibal2.skyhanni.features.bingo.MinionCraftHelper import at.hannibal2.skyhanni.features.bingo.card.BingoCardDisplay -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import at.hannibal2.skyhanni.utils.repopatterns.RepoPatternManager -import at.hannibal2.skyhanni.events.PreInitFinished import at.hannibal2.skyhanni.features.bingo.card.BingoCardReader import at.hannibal2.skyhanni.features.bingo.card.BingoCardTips import at.hannibal2.skyhanni.features.bingo.card.nextstephelper.BingoNextStepHelper @@ -329,6 +327,7 @@ import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.MinecraftConsoleFilter.Companion.initLogging import at.hannibal2.skyhanni.utils.NEUVersionCheck.checkIfNeuIsLoaded import at.hannibal2.skyhanni.utils.TabListData +import at.hannibal2.skyhanni.utils.repopatterns.RepoPatternManager import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job @@ -684,7 +683,7 @@ class SkyHanniMod { loadModule(TestShowSlotNumber()) loadModule(SkyHanniDebugsAndTests) loadModule(HotSwapDetection) - PreInitFinished().postAndCatch() + PreInitFinishedEvent().postAndCatch() } @Mod.EventHandler diff --git a/src/main/java/at/hannibal2/skyhanni/events/PreInitFinished.kt b/src/main/java/at/hannibal2/skyhanni/events/PreInitFinished.kt deleted file mode 100644 index 9b36f8826..000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/PreInitFinished.kt +++ /dev/null @@ -1,3 +0,0 @@ -package at.hannibal2.skyhanni.events - -class PreInitFinished : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/PreInitFinishedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/PreInitFinishedEvent.kt new file mode 100644 index 000000000..8294b8bd7 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/PreInitFinishedEvent.kt @@ -0,0 +1,3 @@ +package at.hannibal2.skyhanni.events + +class PreInitFinishedEvent : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index ec5065d5f..8f0c6be6a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -33,7 +33,7 @@ object HarpFeatures { } private val buttonColors = listOf('d', 'e', 'a', '2', '5', '9', 'b') - val inventoryTitleRegex by RepoPattern.pattern("harp.inventory", "^Harp.*") + private val inventoryTitleRegex by RepoPattern.pattern("harp.inventory", "^Harp.*") private fun isHarpGui() = inventoryTitleRegex.matches(openInventoryName()) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternGui.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternGui.kt index b70d54edd..2a2393686 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternGui.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternGui.kt @@ -28,11 +28,11 @@ class RepoPatternGui private constructor() { @field:Bind var search: String = "" - var lastSearch = null as String? - val allKeys = RepoPatternManager.allPatterns.toList() + private var lastSearch = null as String? + private val allKeys = RepoPatternManager.allPatterns.toList() .sortedBy { it.key } .map { RepoPatternInfo(it) } - var searchCache = ObservableList(mutableListOf<RepoPatternInfo>()) + private var searchCache = ObservableList(mutableListOf<RepoPatternInfo>()) class RepoPatternInfo( diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt index 9ebd6c145..5140aa186 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -4,8 +4,9 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzEvent -import at.hannibal2.skyhanni.events.PreInitFinished +import at.hannibal2.skyhanni.events.PreInitFinishedEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent +import at.hannibal2.skyhanni.utils.LorenzUtils.afterChange import at.hannibal2.skyhanni.utils.StringUtils.matches import net.minecraft.launchwrapper.Launch import net.minecraftforge.fml.common.FMLCommonHandler @@ -74,7 +75,7 @@ object RepoPatternManager { @SubscribeEvent fun onConfigInit(event: ConfigLoadEvent) { - config.forceLocal.whenChanged { b, b2 -> reloadPatterns() } + config.forceLocal.afterChange { reloadPatterns() } } /** @@ -127,7 +128,7 @@ object RepoPatternManager { } @SubscribeEvent - fun onPreInitFinished(event: PreInitFinished) { + fun onPreInitFinished(event: PreInitFinishedEvent) { wasPreinitialized = true val dumpDirective = System.getenv("SKYHANNI_DUMP_REGEXES") if (dumpDirective.isNullOrBlank()) return |