mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-02 08:39:59 +01:00
Fix empty compound reading
This commit is contained in:
parent
0ec1116a9e
commit
b0fc931ecd
@ -65,6 +65,11 @@ import java.util.stream.IntStream;
|
|||||||
public CompoundTag compound() throws StringTagParseException {
|
public CompoundTag compound() throws StringTagParseException {
|
||||||
this.buffer.expect(Tokens.COMPOUND_BEGIN);
|
this.buffer.expect(Tokens.COMPOUND_BEGIN);
|
||||||
final CompoundTag compoundTag = new CompoundTag("");
|
final CompoundTag compoundTag = new CompoundTag("");
|
||||||
|
if (this.buffer.peek() == Tokens.COMPOUND_END) {
|
||||||
|
this.buffer.take();
|
||||||
|
return compoundTag;
|
||||||
|
}
|
||||||
|
|
||||||
while (this.buffer.hasMore()) {
|
while (this.buffer.hasMore()) {
|
||||||
final String key = this.key();
|
final String key = this.key();
|
||||||
final Tag tag = this.tag();
|
final Tag tag = this.tag();
|
||||||
|
@ -39,10 +39,9 @@ public class ComponentRewriter1_13 extends ComponentRewriter {
|
|||||||
CompoundTag tag;
|
CompoundTag tag;
|
||||||
try {
|
try {
|
||||||
tag = BinaryTagIO.readString(text);
|
tag = BinaryTagIO.readString(text);
|
||||||
} catch (IOException e) {
|
} catch (Exception e) {
|
||||||
Via.getPlatform().getLogger().warning("Error reading NBT in show_item:" + text);
|
Via.getPlatform().getLogger().warning("Error reading NBT in show_item:" + text);
|
||||||
e.printStackTrace();
|
throw new RuntimeException(e);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundTag itemTag = tag.get("tag");
|
CompoundTag itemTag = tag.get("tag");
|
||||||
|
Loading…
Reference in New Issue
Block a user