From 9df1f12970dafdbf4cb13c76c1df1caed66f4a59 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 27 Nov 2024 15:57:02 +0100 Subject: fix: Incorrect primary codec in lenient profile serialization --- .../nea/firmament/mixins/LenientProfileComponentPatch.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/moe/nea/firmament/mixins') diff --git a/src/main/java/moe/nea/firmament/mixins/LenientProfileComponentPatch.java b/src/main/java/moe/nea/firmament/mixins/LenientProfileComponentPatch.java index b1f9ee4..76b34ba 100644 --- a/src/main/java/moe/nea/firmament/mixins/LenientProfileComponentPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/LenientProfileComponentPatch.java @@ -3,6 +3,10 @@ package moe.nea.firmament.mixins; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.Lifecycle; +import com.mojang.util.UndashedUuid; +import moe.nea.firmament.util.json.FirmCodecs; import net.minecraft.component.type.ProfileComponent; import net.minecraft.util.Uuids; import org.objectweb.asm.Opcodes; @@ -13,9 +17,9 @@ import java.util.UUID; @Mixin(ProfileComponent.class) public class LenientProfileComponentPatch { - // lambda in RecordCodecBuilder.create for BASE_CODEC - @ModifyExpressionValue(method = "method_57508", at = @At(value = "FIELD", opcode = Opcodes.GETSTATIC, target = "Lnet/minecraft/util/Uuids;INT_STREAM_CODEC:Lcom/mojang/serialization/Codec;")) - private static Codec onStaticInit(Codec original) { - return Uuids.CODEC; - } + // lambda in RecordCodecBuilder.create for BASE_CODEC + @ModifyExpressionValue(method = "method_57508", at = @At(value = "FIELD", opcode = Opcodes.GETSTATIC, target = "Lnet/minecraft/util/Uuids;INT_STREAM_CODEC:Lcom/mojang/serialization/Codec;")) + private static Codec onStaticInit(Codec original) { + return FirmCodecs.UUID_LENIENT_PREFER_INT_STREAM; + } } -- cgit