Skip to content

Commit 9450272

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.18
2 parents 8c061ec + c8bce3e commit 9450272

File tree

3 files changed

+13
-35
lines changed

3 files changed

+13
-35
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/bugfix/edge_chunk_not_saved/ChunkManagerMixin.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public static String sanitize(String mixinClassName) {
5959
private final Set<String> mixinOptions = new ObjectOpenHashSet<>();
6060
private final Map<String, String> mixinsMissingMods = new Object2ObjectOpenHashMap<>();
6161

62+
public static boolean isFabric = false;
63+
6264
public Map<String, String> getPermanentlyDisabledMixins() {
6365
return mixinsMissingMods;
6466
}
@@ -71,6 +73,8 @@ private void scanForAndBuildMixinOptions() {
7173
if(stream == null)
7274
continue;
7375
try(Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
76+
if(configFile.contains("fabric"))
77+
isFabric = true;
7478
JsonObject configObject = (JsonObject)new JsonParser().parse(reader);
7579
JsonArray mixinList = configObject.getAsJsonArray("mixins");
7680
String packageName = configObject.get("package").getAsString().replace('.', '/');
@@ -178,15 +182,20 @@ private ModernFixEarlyConfig(File file) {
178182
disableIfModPresent("mixin.perf.thread_priorities", "smoothboot");
179183
disableIfModPresent("mixin.perf.boost_worker_count", "smoothboot");
180184
disableIfModPresent("mixin.perf.async_jei", "modernui");
181-
disableIfModPresent("mixin.perf.compress_biome_container", "chocolate", "betterendforge");
185+
disableIfModPresent("mixin.perf.compress_biome_container", "chocolate", "betterendforge" ,"skyblockbuilder");
182186
disableIfModPresent("mixin.bugfix.mc218112", "performant");
183187
disableIfModPresent("mixin.bugfix.remove_block_chunkloading", "performant");
184188
disableIfModPresent("mixin.bugfix.paper_chunk_patches", "c2me");
189+
// DimThread makes changes to the server chunk manager (understandably), C2ME probably does the same
190+
disableIfModPresent("mixin.bugfix.chunk_deadlock", "c2me", "dimthread");
185191
disableIfModPresent("mixin.perf.reuse_datapacks", "tac");
186192
disableIfModPresent("mixin.launch.class_search_cache", "optifine");
187193
disableIfModPresent("mixin.perf.faster_texture_stitching", "optifine");
188194
disableIfModPresent("mixin.perf.datapack_reload_exceptions", "cyanide");
189195
disableIfModPresent("mixin.perf.faster_texture_loading", "stitch", "optifine", "changed");
196+
if(isFabric) {
197+
disableIfModPresent("mixin.bugfix.packet_leak", "memoryleakfix");
198+
}
190199
}
191200

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

common/src/main/java/org/embeddedt/modernfix/util/CanonizingStringMap.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,16 @@ public int hashCode() {
141141
}
142142

143143
public static <T> CanonizingStringMap<T> deepCopy(CanonizingStringMap<T> inputMap, Function<T, T> deepCopier) {
144+
Objects.requireNonNull(deepCopier);
144145
Object2ObjectMap<String, T> copiedBackingMap;
145146
int size = inputMap.backingMap.size();
146147
if(size > GROWTH_THRESHOLD) {
147148
copiedBackingMap = new Object2ObjectOpenHashMap<>(size);
148149
} else
149150
copiedBackingMap = new Object2ObjectArrayMap<>(size);
150151
inputMap.backingMap.object2ObjectEntrySet().forEach(entry -> {
151-
copiedBackingMap.put(entry.getKey(), deepCopier.apply(entry.getValue()));
152+
if(entry.getKey() != null && entry.getValue() != null)
153+
copiedBackingMap.put(entry.getKey(), deepCopier.apply(entry.getValue()));
152154
});
153155
return new CanonizingStringMap<>(copiedBackingMap);
154156
}

0 commit comments

Comments
 (0)