Check if item is null in 1.17.1->1.17 book conversion (#826)

This commit is contained in:
EnZaXD 2024-07-20 17:09:34 +02:00 committed by GitHub
parent 94c755166c
commit b5319dbb32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,6 +102,12 @@ public final class Protocol1_17_1To1_17 extends BackwardsProtocol<ClientboundPac
boolean signing = wrapper.read(Types.BOOLEAN);
wrapper.passthrough(Types.VAR_INT); // Slot comes first
if (item == null) {
wrapper.write(Types.VAR_INT, 0); // Pages length
wrapper.write(Types.BOOLEAN, false); // Optional title
return;
}
CompoundTag tag = item.tag();
ListTag<StringTag> pagesTag;
StringTag titleTag = null;