Fix legacy nbt parsing

This commit is contained in:
KennyTV 2020-06-29 18:06:23 +02:00
parent a0195c59cc
commit d59749fb03
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -89,7 +89,12 @@ import java.util.stream.IntStream;
public ListTag list() throws StringTagParseException {
final ListTag listTag = new ListTag("");
this.buffer.expect(Tokens.ARRAY_BEGIN);
final boolean prefixedIndex = this.buffer.peek() == '0' && this.buffer.peek(1) == ':';
while (this.buffer.hasMore()) {
if (prefixedIndex) {
this.buffer.takeUntil(':');
}
final Tag next = this.tag();
// TODO: validate type
listTag.add(next);