diff --git a/patches/server/initial-work-on-native-Adventure-codecs.patch b/patches/server/initial-work-on-native-Adventure-codecs.patch index ef1a08a374..46593136d8 100644 --- a/patches/server/initial-work-on-native-Adventure-codecs.patch +++ b/patches/server/initial-work-on-native-Adventure-codecs.patch @@ -73,7 +73,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final @Nullable NamedTextColor value = NamedTextColor.NAMES.value(s); + return value != null ? DataResult.success(value) : DataResult.error(() -> "Cannot convert " + s + " to adventure NamedTextColor"); + } -+ }, TextColor::asHexString); ++ }, textColor -> { ++ if (textColor instanceof NamedTextColor named) { ++ return NamedTextColor.NAMES.keyOrThrow(named); ++ } else { ++ return textColor.asHexString(); ++ } ++ }); + + private static final Codec KEY_CODEC = Codec.STRING.comapFlatMap(s -> { + return Key.parseable(s) ? DataResult.success(Key.key(s)) : DataResult.error(() -> "Cannot convert " + s + " to adventure Key");