diff --git a/src/main/kotlin/skytils/skytilsmod/Skytils.kt b/src/main/kotlin/skytils/skytilsmod/Skytils.kt index dc54e6504..59d19ecb7 100644 --- a/src/main/kotlin/skytils/skytilsmod/Skytils.kt +++ b/src/main/kotlin/skytils/skytilsmod/Skytils.kt @@ -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() @@ -286,7 +287,6 @@ class Skytils { cch.commandMap["rp"] = RepartyCommand } - DataFetcher.preload() MayorInfo.fetchMayorData() MinecraftForge.EVENT_BUS.register(SpamHider()) diff --git a/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt b/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt index 98e012c4a..2e7294d62 100644 --- a/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt +++ b/src/main/kotlin/skytils/skytilsmod/core/DataFetcher.kt @@ -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) {