Skip to content

Commit bd1ca9c

Browse files
committed
Disable reduce_blockstate_cache_rebuilds if dev env is not Mojmap
This is simpler than implementing remapping Closes #229
1 parent fe942c9 commit bd1ca9c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,21 @@ private ModernFixEarlyConfig(File file) {
229229
if(isFabric) {
230230
disableIfModPresent("mixin.bugfix.packet_leak", "memoryleakfix");
231231
}
232+
233+
checkBlockstateCacheRebuilds();
234+
}
235+
236+
private void checkBlockstateCacheRebuilds() {
237+
if(!ModernFixPlatformHooks.INSTANCE.isDevEnv())
238+
return;
239+
try {
240+
if(ModernFixEarlyConfig.class.getResource("/net/minecraft/world/level/Level.class") == null) {
241+
LOGGER.warn("We are in a non-Mojmap dev environment. Disabling blockstate cache patch");
242+
this.options.get("mixin.perf.reduce_blockstate_cache_rebuilds").addModOverride(false, "[not mojmap]");
243+
}
244+
} catch(Throwable e) {
245+
e.printStackTrace();
246+
}
232247
}
233248

234249
private void disableIfModPresent(String configName, String... ids) {

0 commit comments

Comments
 (0)