Skip to content

Commit 673e6de

Browse files
committed
Merge remote-tracking branch 'origin/1.19.2' into 1.19.4
2 parents a635671 + f8771a2 commit 673e6de

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.embeddedt.modernfix.common.mixin.perf.nbt_memory_usage;
2+
3+
import net.minecraft.nbt.Tag;
4+
import org.embeddedt.modernfix.util.CanonizingStringMap;
5+
import org.spongepowered.asm.mixin.Mixin;
6+
import org.spongepowered.asm.mixin.injection.At;
7+
import org.spongepowered.asm.mixin.injection.ModifyVariable;
8+
9+
import java.util.Map;
10+
11+
@Mixin(targets = "net/minecraft/nbt/CompoundTag$1")
12+
public class CompoundTag1Mixin {
13+
@ModifyVariable(method = "load(Ljava/io/DataInput;ILnet/minecraft/nbt/NbtAccounter;)Lnet/minecraft/nbt/CompoundTag;", at = @At(value = "INVOKE_ASSIGN", target = "Lcom/google/common/collect/Maps;newHashMap()Ljava/util/HashMap;", remap = false))
14+
private Map<String, Tag> modifyMap(Map<String, Tag> map) {
15+
CanonizingStringMap<Tag> newMap = new CanonizingStringMap<>();
16+
if(map != null)
17+
newMap.putAll(map);
18+
return newMap;
19+
}
20+
}

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/nbt_memory_usage/CompoundTagMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public class CompoundTagMixin {
2222
@ModifyArg(method = "<init>()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/CompoundTag;<init>(Ljava/util/Map;)V"), index = 0)
2323
private static Map<String, Tag> useCanonizingStringMap(Map<String, Tag> incoming) {
2424
CanonizingStringMap<Tag> newMap = new CanonizingStringMap<>();
25-
newMap.putAll(incoming);
25+
if(incoming != null)
26+
newMap.putAll(incoming);
2627
return newMap;
2728
}
2829

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ private ModernFixEarlyConfig(File file) {
186186
disableIfModPresent("mixin.bugfix.mc218112", "performant");
187187
disableIfModPresent("mixin.bugfix.remove_block_chunkloading", "performant");
188188
disableIfModPresent("mixin.bugfix.paper_chunk_patches", "c2me");
189+
disableIfModPresent("mixin.perf.nbt_memory_usage", "c2me");
189190
// DimThread makes changes to the server chunk manager (understandably), C2ME probably does the same
190191
disableIfModPresent("mixin.bugfix.chunk_deadlock", "c2me", "dimthread");
191192
disableIfModPresent("mixin.perf.reuse_datapacks", "tac");

0 commit comments

Comments
 (0)