Fix 1.17 clients writing empty books

Fixes #2658
This commit is contained in:
kennytv 2021-08-11 15:11:56 +02:00
parent c9142223fd
commit 9ee548b967
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -102,6 +102,11 @@ public final class Protocol1_17_1To1_17 extends AbstractProtocol<ClientboundPack
pagesTag.add(new StringTag(page)); pagesTag.add(new StringTag(page));
} }
// Legacy servers don't like an empty pages list
if (pagesTag.size() == 0) {
pagesTag.add(new StringTag(""));
}
tag.put("pages", pagesTag); tag.put("pages", pagesTag);
if (wrapper.read(Type.BOOLEAN)) { if (wrapper.read(Type.BOOLEAN)) {