Merge remote-tracking branch 'origin/main' into 1.18

This commit is contained in:
embeddedt 2023-06-03 11:27:32 -04:00
commit 39531aba0e
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
3 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,20 @@
package org.embeddedt.modernfix.common.mixin.perf.nbt_memory_usage;
import net.minecraft.nbt.Tag;
import org.embeddedt.modernfix.util.CanonizingStringMap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import java.util.Map;
@Mixin(targets = "net/minecraft/nbt/CompoundTag$1")
public class CompoundTag1Mixin {
@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))
private Map<String, Tag> modifyMap(Map<String, Tag> map) {
CanonizingStringMap<Tag> newMap = new CanonizingStringMap<>();
if(map != null)
newMap.putAll(map);
return newMap;
}
}

View File

@ -22,7 +22,8 @@ public class CompoundTagMixin {
@ModifyArg(method = "<init>()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/CompoundTag;<init>(Ljava/util/Map;)V"), index = 0)
private static Map<String, Tag> useCanonizingStringMap(Map<String, Tag> incoming) {
CanonizingStringMap<Tag> newMap = new CanonizingStringMap<>();
newMap.putAll(incoming);
if(incoming != null)
newMap.putAll(incoming);
return newMap;
}

View File

@ -186,6 +186,7 @@ public class ModernFixEarlyConfig {
disableIfModPresent("mixin.bugfix.mc218112", "performant");
disableIfModPresent("mixin.bugfix.remove_block_chunkloading", "performant");
disableIfModPresent("mixin.bugfix.paper_chunk_patches", "c2me");
disableIfModPresent("mixin.perf.nbt_memory_usage", "c2me");
// DimThread makes changes to the server chunk manager (understandably), C2ME probably does the same
disableIfModPresent("mixin.bugfix.chunk_deadlock", "c2me", "dimthread");
disableIfModPresent("mixin.perf.reuse_datapacks", "tac");