Currently, storing multiple Written Books or Book and Quills inside containers (chests, chiseled bookshelves, lecterns) loads all raw text NBT data into the chunk payload simultaneously. When handling large libraries, or overall a lot of books for reasons, this creates severe "NBT bloat," causing localized TPS drops, chunk loading lag, and frequent Payload too large kick errors for players.
Proposed Solution:
Implement an on-demand (lazy-loading) data structure for written book text:
-
Decouple Text Data from Chunk Load: Containers and tile entities should only store basic item metadata (ID, title, author, generation, page count) while the item sits in a chest, shelf, or lectern.
-
Load Pages Upon Right-Click: Full page text NBT should only be queried, parsed, and transferred over the network packet to the client at the exact moment a player actively interacts with/opens the book.
-
External Cache/Database Handling: Unused text data remains compressed in the server/world save storage without being actively parsed by the main engine loop during regular chunk rendering.
Benefits:
-
Server Performance: Eliminates chunk-loading stutters caused by reading thousands of pages of unread text NBT data.
-
Prevents Disconnections: Removes the risk of packet buffer overflows (
Payload too large) in massive custom libraries or map-building projects. -
Expanded World Building: Enables builders and server administrators to create detailed, lore-rich libraries without risking world corruption or client crashes.
Please sign in to leave a comment.
0 Comments