Disable packet leak fix when MemoryLeakFix is present on Fabric

This commit is contained in:
embeddedt 2023-06-01 19:45:19 -04:00
parent 1a7d5b3436
commit 4b73d699e4
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -59,6 +59,8 @@ public class ModernFixEarlyConfig {
private final Set<String> mixinOptions = new ObjectOpenHashSet<>(); private final Set<String> mixinOptions = new ObjectOpenHashSet<>();
private final Map<String, String> mixinsMissingMods = new Object2ObjectOpenHashMap<>(); private final Map<String, String> mixinsMissingMods = new Object2ObjectOpenHashMap<>();
public static boolean isFabric = false;
public Map<String, String> getPermanentlyDisabledMixins() { public Map<String, String> getPermanentlyDisabledMixins() {
return mixinsMissingMods; return mixinsMissingMods;
} }
@ -71,6 +73,8 @@ public class ModernFixEarlyConfig {
if(stream == null) if(stream == null)
continue; continue;
try(Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) { try(Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
if(configFile.contains("fabric"))
isFabric = true;
JsonObject configObject = (JsonObject)new JsonParser().parse(reader); JsonObject configObject = (JsonObject)new JsonParser().parse(reader);
JsonArray mixinList = configObject.getAsJsonArray("mixins"); JsonArray mixinList = configObject.getAsJsonArray("mixins");
String packageName = configObject.get("package").getAsString().replace('.', '/'); String packageName = configObject.get("package").getAsString().replace('.', '/');
@ -192,6 +196,9 @@ public class ModernFixEarlyConfig {
disableIfModPresent("mixin.perf.faster_texture_stitching", "optifine"); disableIfModPresent("mixin.perf.faster_texture_stitching", "optifine");
disableIfModPresent("mixin.perf.datapack_reload_exceptions", "cyanide"); disableIfModPresent("mixin.perf.datapack_reload_exceptions", "cyanide");
disableIfModPresent("mixin.perf.faster_texture_loading", "stitch", "optifine", "changed"); disableIfModPresent("mixin.perf.faster_texture_loading", "stitch", "optifine", "changed");
if(isFabric) {
disableIfModPresent("mixin.bugfix.packet_leak", "memoryleakfix");
}
} }
private void disableIfModPresent(String configName, String... ids) { private void disableIfModPresent(String configName, String... ids) {