Disable class info clearing by default and only clear non-mixin entries
This commit is contained in:
parent
74c3f0ff90
commit
f27d94cf26
|
|
@ -42,6 +42,7 @@ public class ModernFixEarlyConfig {
|
|||
this.addMixinRule("perf.state_definition_construct", modPresent("ferritecore"));
|
||||
this.addMixinRule("perf.cache_strongholds", true);
|
||||
this.addMixinRule("perf.dedup_blockstate_flattening_map", false);
|
||||
this.addMixinRule("perf.clear_mixin_classinfo", false);
|
||||
this.addMixinRule("perf.cache_upgraded_structures", true);
|
||||
this.addMixinRule("perf.biome_zoomer", true);
|
||||
this.addMixinRule("perf.compress_blockstate", false);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.embeddedt.modernfix.util;
|
||||
|
||||
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
|
||||
import org.spongepowered.asm.mixin.transformer.ClassInfo;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
|
@ -9,6 +10,8 @@ import java.util.Map;
|
|||
public class ClassInfoManager {
|
||||
private static Map<String, ClassInfo> classInfoCache = null;
|
||||
public static void clear() {
|
||||
if(!ModernFixMixinPlugin.instance.isOptionEnabled("perf.clear_mixin_classinfo.ClassInfoManager"))
|
||||
return;
|
||||
if(classInfoCache == null) {
|
||||
try {
|
||||
Field field = ClassInfo.class.getDeclaredField("cache");
|
||||
|
|
@ -20,7 +23,7 @@ public class ClassInfoManager {
|
|||
}
|
||||
}
|
||||
try {
|
||||
classInfoCache.entrySet().removeIf(entry -> !entry.getKey().equals("java/lang/Object"));
|
||||
classInfoCache.entrySet().removeIf(entry -> !entry.getKey().equals("java/lang/Object") && (entry.getValue() == null || !entry.getValue().isMixin()));
|
||||
} catch(RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user