Skip to content

Commit

Permalink
maybe fix repo hiders idk
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Dec 12, 2021
1 parent a4c25b6 commit 21b9985
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/skytils/skytilsmod/Skytils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class Skytils {

@Mod.EventHandler
fun preInit(event: FMLPreInitializationEvent) {
DataFetcher.preload()
if (!modDir.exists()) modDir.mkdirs()
File(modDir, "trackers").mkdirs()
guiManager = GuiManager()
Expand Down Expand Up @@ -286,7 +287,6 @@ class Skytils {
cch.commandMap["rp"] = RepartyCommand
}

DataFetcher.preload()
MayorInfo.fetchMayorData()

MinecraftForge.EVENT_BUS.register(SpamHider())
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ object DataFetcher {
}
APIUtil.getArrayResponse("${Skytils.config.dataURL}SpamFilters.json").apply {
Utils.checkThreadAndQueue {
val filters = SpamHider.repoFilters.toHashSet()
SpamHider.repoFilters.clear()
mapTo(SpamHider.repoFilters) {
it as JsonObject
SpamHider.Filter(
it["name"].asString,
0,
filters.find { f -> f.name == it["name"].asString }?.state ?: 0,
true,
it["pattern"].asString.toRegex(),
when (it["type"].asString) {
Expand Down

0 comments on commit 21b9985

Please sign in to comment.