Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Dec 8, 2023
1 parent 7eb5b1c commit 854a1f7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
7 changes: 3 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -684,7 +683,7 @@ class SkyHanniMod {
loadModule(TestShowSlotNumber())
loadModule(SkyHanniDebugsAndTests)
loadModule(HotSwapDetection)
PreInitFinished().postAndCatch()
PreInitFinishedEvent().postAndCatch()
}

@Mod.EventHandler
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/at/hannibal2/skyhanni/events/PreInitFinished.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package at.hannibal2.skyhanni.events

class PreInitFinishedEvent : LorenzEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,7 +75,7 @@ object RepoPatternManager {

@SubscribeEvent
fun onConfigInit(event: ConfigLoadEvent) {
config.forceLocal.whenChanged { b, b2 -> reloadPatterns() }
config.forceLocal.afterChange { reloadPatterns() }
}

/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 854a1f7

Please sign in to comment.