Disable reduce_blockstate_cache_rebuilds if dev env is not Mojmap

This is simpler than implementing remapping

Closes #229
This commit is contained in:
embeddedt 2023-09-17 13:00:54 -04:00
parent fe942c90df
commit bd1ca9ce94
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -229,6 +229,21 @@ public class ModernFixEarlyConfig {
if(isFabric) {
disableIfModPresent("mixin.bugfix.packet_leak", "memoryleakfix");
}
checkBlockstateCacheRebuilds();
}
private void checkBlockstateCacheRebuilds() {
if(!ModernFixPlatformHooks.INSTANCE.isDevEnv())
return;
try {
if(ModernFixEarlyConfig.class.getResource("/net/minecraft/world/level/Level.class") == null) {
LOGGER.warn("We are in a non-Mojmap dev environment. Disabling blockstate cache patch");
this.options.get("mixin.perf.reduce_blockstate_cache_rebuilds").addModOverride(false, "[not mojmap]");
}
} catch(Throwable e) {
e.printStackTrace();
}
}
private void disableIfModPresent(String configName, String... ids) {