aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-26 21:12:46 +0100
committerGitHub <noreply@github.com>2024-03-26 21:12:46 +0100
commitc41274af219e124a8af87786f3eb5442ee1bea65 (patch)
treedf91c306ce034a88662ea48a5a526158e82912fb /src/main
parenta449160bf732e450b0b8014c1035b7a6e12bfdb8 (diff)
downloadskyhanni-c41274af219e124a8af87786f3eb5442ee1bea65.tar.gz
skyhanni-c41274af219e124a8af87786f3eb5442ee1bea65.tar.bz2
skyhanni-c41274af219e124a8af87786f3eb5442ee1bea65.zip
Backend: always use local repo patterns when in dev env (#1282)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt5
1 files changed, 4 insertions, 1 deletions
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 27ceb7181..97f9196f2 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.events.LorenzEvent
import at.hannibal2.skyhanni.events.PreInitFinishedEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.utils.ConditionalUtils.afterChange
+import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.matches
import net.minecraft.launchwrapper.Launch
import net.minecraftforge.fml.common.FMLCommonHandler
@@ -57,6 +58,8 @@ object RepoPatternManager {
}
}
+ val localLoading: Boolean get() = config.forceLocal.get() || LorenzUtils.isInDevEnviromen()
+
/**
* Crash if in a development environment, or if inside a guarded event handler.
*/
@@ -98,7 +101,7 @@ object RepoPatternManager {
*/
private fun reloadPatterns() {
val remotePatterns =
- if (config.forceLocal.get()) mapOf()
+ if (localLoading) mapOf()
else regexes?.regexes ?: mapOf()
for (it in usedKeys.values) {