Skip to content

Commit f391e97

Browse files
committed
Handle Knot behaving differently from FML with getResource
1 parent fd68efe commit f391e97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.spongepowered.asm.mixin.Mixin;
2121

2222
import java.io.*;
23+
import java.net.URL;
2324
import java.nio.charset.StandardCharsets;
2425
import java.util.*;
2526
import java.util.function.BooleanSupplier;
@@ -235,7 +236,10 @@ private void checkBlockstateCacheRebuilds() {
235236
if(!ModernFixPlatformHooks.INSTANCE.isDevEnv())
236237
return;
237238
try {
238-
if(ModernFixEarlyConfig.class.getClassLoader().getResource("/net/minecraft/world/level/Level.class") == null) {
239+
URL deobfClass = isFabric ?
240+
ModernFixEarlyConfig.class.getResource("/net/minecraft/world/level/Level.class") :
241+
ModernFixEarlyConfig.class.getClassLoader().getResource("/net/minecraft/world/level/Level.class");
242+
if(deobfClass == null) {
239243
LOGGER.warn("We are in a non-Mojmap dev environment. Disabling blockstate cache patch");
240244
this.options.get("mixin.perf.reduce_blockstate_cache_rebuilds").addModOverride(false, "[not mojmap]");
241245
}

0 commit comments

Comments
 (0)