From 3b5aaa1ff50e88abf063c0bce6ddf7deea7a8560 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Sun, 8 Nov 2020 10:35:15 +0100 Subject: [PATCH] Fix legacy nbt array weirdness Closes #2176 --- .../myles/ViaVersion/api/minecraft/nbt/TagStringReader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/src/main/java/us/myles/ViaVersion/api/minecraft/nbt/TagStringReader.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/nbt/TagStringReader.java index 85cbce6e7..b33f66ea3 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/minecraft/nbt/TagStringReader.java +++ b/common/src/main/java/us/myles/ViaVersion/api/minecraft/nbt/TagStringReader.java @@ -96,6 +96,11 @@ import java.util.stream.IntStream; this.buffer.expect(Tokens.ARRAY_BEGIN); final boolean prefixedIndex = this.buffer.peek() == '0' && this.buffer.peek(1) == ':'; while (this.buffer.hasMore()) { + if (this.buffer.peek() == Tokens.ARRAY_END) { + this.buffer.advance(); + return listTag; + } + if (prefixedIndex) { this.buffer.takeUntil(':'); }