mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-30 14:55:07 +01:00
fix: Resolve issue with book & quills on lectern contraptions
Resolves #7253. Where an attempt to parse JSON out of a writable book (not a written book), which has raw string data for the pages array caused a game crash.
This commit is contained in:
parent
18fb3b4beb
commit
ebc65f6df5
1 changed files with 6 additions and 1 deletions
|
@ -47,6 +47,11 @@ public final class NBTProcessors {
|
||||||
return data;
|
return data;
|
||||||
CompoundTag tag = book.getCompound("tag");
|
CompoundTag tag = book.getCompound("tag");
|
||||||
|
|
||||||
|
// Check for book & quill, which does not have json pages and
|
||||||
|
// therefore can't have click events. Written books have an "author" tag.
|
||||||
|
if (!tag.contains("author", Tag.TAG_LIST))
|
||||||
|
return data;
|
||||||
|
|
||||||
if (!tag.contains("pages", Tag.TAG_LIST))
|
if (!tag.contains("pages", Tag.TAG_LIST))
|
||||||
return data;
|
return data;
|
||||||
ListTag pages = tag.getList("pages", Tag.TAG_STRING);
|
ListTag pages = tag.getList("pages", Tag.TAG_STRING);
|
||||||
|
|
Loading…
Reference in a new issue