summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-08 15:04:11 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-08 15:04:11 +0100
commit854a1f71eac59e6f8f0d1f2680124f06823b76b7 (patch)
treeee38146b0473d3cc4ae07e57f64f5c861e7f42a8 /src/main/java/at/hannibal2/skyhanni/utils
parent7eb5b1c7f11fccbee97791745c92f6f5df4826dd (diff)
downloadskyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.tar.gz
skyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.tar.bz2
skyhanni-854a1f71eac59e6f8f0d1f2680124f06823b76b7.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternGui.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt7
2 files changed, 7 insertions, 6 deletions
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