pc 26.3: add entityDelta type for the new stepped entity-move encoding - #1538
Open
DallasCarraher wants to merge 1 commit into
Open
DallasCarraher wants to merge 1 commit into
DallasCarraher wants to merge 1 commit into
Conversation
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>
Open
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
26.3 replaced
ClientboundMoveEntityPacket's (rel_entity_move / entity_move_look) flat 3x-i16delta with a packed
propertiesvarint (bit 0 = onGround, remaining bits = stepCount) followedby either the old flat format (
stepCount <= 0) orstepCountchained{ticks: varint, dX, dY, dZ: i16}DeltaStep entries used for smoother client-side interpolationwhen the server batches more than one tick's movement into a single packet.
Without this, minecraft-data's 26.3 schema (see paired PR
minecraft-data#1301) still assumed
the old flat format, so almost every entity-movement packet was silently misparsed as soon as
there was more than one nearby entity -- flooding the console with
Chunk size is N but only M was read ; partial packet : rel_entity_move/PartialReadError.The step count depends on a value derived from
propertiesat parse time (properties >>> 1),which plain protodef
container/switch/countTypecan't express (those only reference asibling field's raw value, not a transform of it). This adds a native
entityDeltatype(read/write/sizeOf, registered in both the interpreted and compiled datatype tables) following
the existing
UUID/restBuffer/entityMetadataLoopcustom-type pattern, exposing a uniform{ onGround, steps: [{ dX, dY, dZ, ticks }] }shape regardless of which wire variant was used.Root cause found by decompiling
VecDelta,VecDelta$Stepped$DeltaStep,ClientboundMoveEntityPacket(.Pos/.PosRot) and theirpackProperties/unpackStepCountstatic helpers in the real 26.3 server jar (
javap -c -p), continuing the precedent frommineflayer#3888.
Depends on / paired with:
referencing this type via
packet_rel_entity_move.move/packet_entity_move_look.move)lib/plugins/entities.jsto consumepacket.move.steps(PR to follow)Test plan
entityDeltaread/write/sizeOf against synthetic linear andmulti-step buffers, including the exact
dX:769, dY:-145values from the original crashreport.
mobs constantly moving: thousands of
rel_entity_move/entity_move_lookpackets andhundreds of stepped
sync_entity_positionpackets parsed with zeroChunk size is ... was readwarnings, entity positions tracked sanely (no NaN/drift).of
rel_entity_move/entity_move_lookpackets (including real multi-step packets withticks > 1) and hundreds ofsync_entity_positionpackets, zero warnings for these packettypes.