Skip to content

26.3: merge master, entityDelta (#1538), packet round-trip tests, no protodef override - #1553

Open
suisarbre wants to merge 9 commits into
PrismarineJS:pc26_3from
suisarbre:port-26.3
Open

suisarbre wants to merge 9 commits into
PrismarineJS:pc26_3from
suisarbre:port-26.3

Conversation

@suisarbre

Copy link
Copy Markdown

Targets pc26_3 (the branch behind #1532), the same way #1550 finished 26.2.

Changes

No source changes beyond #1538 were needed: with the data fixes in PrismarineJS/minecraft-data#1345 the 26.3 encodings are all described in minecraft-data.

Testing

With minecraft-data from PrismarineJS/minecraft-data#1345 and the published protodef:

  • npm run mochaTest -- -g 26.3v against a vanilla 26.3 server: 260 passing, 2 pending, 1 failing. The failure is pings the server (ECONNRESET), the Windows-only one 26.2: merge master and drop the protodef debug overrides #1550 saw on 26.1 too.
  • test/packetTest.js: 26.3v 233 passing; 26.1v 229, 1.21.11v 224, 1.20.4v 202 (unchanged).
  • standard clean.
  • A bare client on a vanilla 26.3 server running nine data packs for 10 minutes (teams, custom item components, scoreboards, explosions, new entities and particles): 0 parse errors, 0 partial packets.

🤖 Generated with Claude Code

DallasCarraher and others added 9 commits September 18, 2026 16:10
26.3's ClientboundMoveEntityPacket (rel_entity_move / entity_move_look)
replaced the flat 3x-i16 delta with a packed `properties` varint (onGround
bit + stepCount) followed by either the old flat format (stepCount <= 0)
or `stepCount` chained {ticks, dX, dY, dZ} DeltaStep entries. The sub-count
depends on a value derived from properties at parse time (properties >>>
1), which plain protodef container/switch/countType can't express since
those only reference a sibling field's raw value, not a transform of it.

Adds a native `entityDelta` type (read/write/sizeOf, registered in both
the interpreted and compiled datatype tables, following the existing
UUID/restBuffer/entityMetadataLoop pattern) that reads/writes the whole
properties+delta combo and exposes a uniform
`{ onGround, steps: [{ dX, dY, dZ, ticks }] }` shape regardless of which
wire variant was used, so minecraft-data's schema and downstream consumers
(mineflayer) never have to branch on stepCount themselves. Verified with a
roundtrip unit test and against the manual byte layout from the original
crash report's dX:769/dY:-145 values.

Depends on the matching minecraft-data schema change
(DallasCarraher/minecraft-data, pc-26.3-support branch) that references
this type by name from packet_rel_entity_move / packet_entity_move_look.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
)

* compression: enforce maximum uncompressed packet size

The decompressor inflated packets with no bound on the output size, so a peer could send a small packet that expands to an unbounded synchronous allocation. Cap the inflate at the protocol maximum (2^23 bytes) via zlib's maxOutputLength and reject packets whose declared length already exceeds it.

* compressionTest: add round trip test

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: extremeheat <extreme@protonmail.ch>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* checksum last seen messages in acknowledgement order

Use the circular buffer's logical traversal for both acknowledgement bits and
the checksum so wrapped chat histories stay synchronized with the server.

* follow-up to PrismarineJS#1521 - added server test and fixed incorrect logic

added a loopback integration test using node-minecraft-protocol's real server and client. It rotates the 20-message history, sends a standalone acknowledgement, verifies that a correctly checksummed/signed message is accepted, then changes only the next checksum and verifies that the server rejects it.
…marineJS#1529)

26.2 (protocol 776) added a mandatory sessionId: UUID field to
packet_success. Since the server-side login flow built the packet
without it, the compiled protodef writer threw
"Write error for undefined : Cannot read properties of undefined
(reading 'length')" as soon as a 26.2 client logged in against a
server built on this library — every consumer that hosts its own
server (flying-squid, mineflayer's test harness, etc.), not clients
connecting to a real Mojang server (which always supplies it).

Included unconditionally rather than gated behind a supportFeature
check: protodef only reads the fields a version's schema defines, so
this is inert on older versions' packet_success where the field
doesn't exist.

Found and fixed while getting PrismarineJS/minecraft-data#1298 (26.2
data) working end-to-end. Full suite: 6787 passing, 73 pending, 2
failing — both pre-existing and unrelated (a 1.16.5 server-download
timeout, and a 26.1 packet-fuzzer gap for the ItemStackTemplate type
that predates this change). Zero failures attributable to 26.2.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
26.1 introduced the ItemStackTemplate type (used by SlotComponent, Particle,
SlotDisplay and advancements), and packetTest had no value for it, failing
with 'No value for type ItemStackTemplate'.


Claude-Session: https://claude.ai/code/session_01MY5J9XTnWK8ZsJTmxvi7vF

Co-authored-by: Claude <noreply@anthropic.com>
…ket, anonymous position path switch)

- sample value for the entityDelta native type (one linear step, so it round-trips byte-exact)
- a void packet (26.3 punch) is sent as {} and arrives with no params; nothing to compare
- an anonymous switch that falls through to void adds no fields to its container
- sync_entity_position on 26.3+ gets a fixed linear PositionPath payload
- assertPacketsMatch takes the packet's own field list instead of the enclosing loop variable

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he stacked fix branch

The published protodef 1.19 passes the 26.3 packet round trips. The minecraft-data clone points at the branch with
the 26.3 fixes until they land on pc_26_3.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants