7.7 KiB
Open-book drops — issue #114
Initial conversion slice: local 1.21.1.0.9, followed by the interaction candidates below. The existing 26.3 conversion was already player-validated and remains unchanged in 26.3.0.12. That initial conversion slice changed only 1.21.1; the interaction follow-up below changes both versions.
Central conversion
Both targets listen for ordinary ItemEntity joins on the server at LOWEST priority. Linking and Descriptive Books convert regardless of binding state. Pages, Notebooks, folders, portfolios and sealed collections retain ordinary item behavior. Existing DroppedBookEntity instances are skipped.
A queued server task waits until the original join callback completes. It rechecks the level identity, entity registration/removal and item type, then creates a custom book. The source is discarded only if addFreshEntity accepts the replacement. A canceled source cannot create a ghost replacement; canceled replacement spawning leaves the source intact. Another join/reload may retry. There is no per-tick scan, force-loading, or conversion recursion.
This covers Q/Ctrl-Q and inventory tosses, container/loot/dispenser-style item spawns, stand/receptacle contents, full-inventory deliveries, death inventory drops, and Disarm. Existing ordinary book entities loaded from disk take the same join path. Books created directly by handheld travel already use the custom type and retain their existing departure placement.
State and lifetime
fromDrop uses Minecraft's native restoreFrom NBT path, copies the full stack and gives the replacement a fresh UUID while the source is still registered. On 1.21.1 the live transform/motion is copied explicitly after NBT loading, which otherwise clamps very high velocities. Position, facing, velocity, pickup delay, owner/thrower, persistent data and serializable entity metadata are retained. Arbitrary tosses do not get the handheld departure constructor's extra height or zero velocity.
The replacement adopts open-book lifetime (unlimited ordinary ItemEntity age) and the existing slow book decay and rain/water damage. The original ordinary despawn age is intentionally not retained. Normal book entity save/load retains its own decay clock thereafter.
The 1.21.1 custom copy() override remains intact so client pickup particles keep the custom renderer type.
Validation
Run only the changed target: python3 scripts/regression_drop114.py mc1211
A disposable server probe exercises native metadata/component copying, bound and unwritten variants, direct joins and NBT-loaded item joins, actual player toss, container drop, stand break/full inventory retrieval, station break, Disarm, inventory death-path drops, already-custom skip, non-book items, cancellation and retry, custom NBT round trip and pickup-copy entity type. Temporary worlds and fixture outputs are removed on pass or fail. Stop and hand off a stalled probe.
Player checks on 1.21.1:
- Q/Ctrl-Q and inventory/cursor tosses for Linking/Descriptive Books, bound and unwritten. Verify open-book orientation, throw motion, pickup delay, name, destination and modifiers.
- Break a loaded stand; expect one lectern and exactly one open book. Shift-remove with a full inventory. Repeat with a receptacle and Link Modifier station.
- Test death and Disarm drops and handheld travel. Full-inventory Return Link delivery can be checked if automatic Return Links are explicitly enabled.
- Leave/reload the chunk and restart with books on the ground. Pick them up and verify no client pickup-particle crash. Pages/collections stay ordinary items.
An NBT round trip is not a full server restart, and FakePlayer drop paths do not replace real GUI, death, portal or client rendering acceptance.
Automated result
The isolated 1.21.1 server probe passed 62 checks. High-velocity native NBT loading was accounted for by explicitly retaining live transform/motion. No test stalled; the disposable world and fixture build outputs were deleted. The production build passes. No new 26.3 code or tests were run for this root-only change. Player acceptance was subsequently reported; included in 1.21.1.0.12.
Legacy-style interaction follow-up
Candidates 1.21.1.0.10 and 26.3.0.13 add:
- Walking over a custom dropped book never picks it up.
- Right-click opens the existing Linking/Descriptive Book GUI. Clicking its destination panel uses normal linking rules and leaves the same book in place.
- Shift-right-click explicitly attempts normal item pickup, respecting ownership, pickup delay, inventory capacity and NeoForge pickup hooks. A full inventory leaves the book in the world. This uses inventory pickup rather than Legacy's special empty-hand assignment.
- Ground books use the lectern-style view: rotating destination previews are supported, interactive exploration is disabled. GUI input closes if the entity disappears or moves out of reach.
- Unwritten dropped books retain their naming/binding screens. The server resolves and updates the actual nearby entity, never a held item.
- ID + UUID + expected full stack + alive/range checks reject stale, replaced, picked-up or remote source actions. Normal travel rules and 26.3 catalog acknowledgement remain in effect. Preview leases on 26.3 also validate the dropped entity and distinguish it from hands/stands.
Reviewed local Legacy EntityLinkbook interaction bytecode. Legacy uses sneaking and an empty hand for direct hand pickup, otherwise opens BOOK_ENTITY. Rivencraft keeps the requested gesture but uses existing pickup permissions/hooks.
New dropped-action/open-screen payloads reuse existing screens and binding/travel helpers. 1.21.1 networking protocol is 20; 26.3 book-network registration is 2. The 26.3 preview request adds an optional dropped-entity UUID with a default constructor for existing hand/stand callers. Update clients and servers together.
Sequential isolated interaction probes exercise no-contact pickup, normal open, explicit pickup with owner/delay/full-inventory checks, stale/forged/remote source rejection, actual binding helper dispatch, teleport request dispatch without duplicating/removing the ground book, and packet codec round trips. The fixture captures teleport requests because FakePlayer's connection intentionally ignores teleports. It does not establish real client rendering or dimension transition. The 26.3 fixture acknowledges its catalog explicitly; there is no production bypass.
Player checks on both versions:
- Drop bound Linking and Descriptive Books. Walk over each: no pickup.
- Right-click: normal book GUI, rotating preview when its optional renderer is available, and no usable interactive-view control. Click the destination panel to travel. Return and verify the same book remains.
- Shift-right-click to collect, including a full inventory and a fresh toss's pickup delay. Confirm contents/title/modifiers remain intact.
- Try unwritten books, input names/bind and reopen. Check changing/removing the ground book while its GUI is open closes it safely.
- Check reload/restart, ordinary held/stand book GUIs and optional live previews.
Follow-up automated result
Interaction probes passed sequentially: 21 checks on 1.21.1, 23 on 26.3. No stall occurred; temporary worlds were deleted. Dedicated-server startup caught and corrected eager client-screen class loading on 1.21.1; client handling now uses a deferred lambda. The fixtures capture teleport dispatch and simulate the 26.3 catalog acknowledgement; the player subsequently reported in-game acceptance on both versions. No independent automated full client/restart matrix is claimed. Logs remain in build/verification/drop_interactions.
The complete interaction update is included in releases 1.21.1.0.12 and 26.3.0.15.