Allow adventure nbt codec to parse all tags

This commit is contained in:
Jake Potrebic
2025-06-28 13:05:31 -07:00
parent bd79e20c66
commit 57c202e015

View File

@@ -128,10 +128,11 @@ public final class PaperAdventure {
@Deprecated
public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build();
public static final ANSIComponentSerializer ANSI_SERIALIZER = ANSIComponentSerializer.builder().flattener(FLATTENER).build();
private static final TagParser<Tag> NBT_PARSER = TagParser.create(NbtOps.INSTANCE);
public static final Codec<Tag, String, CommandSyntaxException, RuntimeException> NBT_CODEC = new Codec<>() {
@Override
public @NotNull Tag decode(final @NotNull String encoded) throws CommandSyntaxException {
return TagParser.parseCompoundFully(encoded);
return NBT_PARSER.parseFully(encoded);
}
@Override