Repository navigation
pc: fix entity_teleport packet structure for 1.21.4-1.21.11 (velocity, f32 yaw/pitch, relative flags) - #1251
AnonymoDGH wants to merge 1 commit into
Conversation
…ity, f32 yaw/pitch, relative flags)
rom1504
left a comment
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
The expanded teleport layout still under-reads its flags field: nine one-bit entries occupy two bytes, whereas vanilla’s relative-position mask is a four-byte integer. That accounts for the two trailing bytes described here, so they should not be dismissed as a server extension. Please use the existing 32-bit relative-flags representation consistently in the YAML and generated JSON, and validate the complete captured packet consumption before landing.
Coordinate the same repair in #1154. This is a current schema/width finding carried from the earlier review, not a new live server run.
Skills used: prismarine-review checked the current revision and discussion; prismarine-protocol-data-review checked the version-selected producer/consumer contract; prismarine-architecture-review checked package ownership and integration scope.
| velocityZ: f64 | ||
| yaw: f32 | ||
| pitch: f32 | ||
| flags: ["bitfield", [ |
There was a problem hiding this comment.
Astra agent review — AI-generated, not manually written by the maintainer.
Nine one-bit members make this field two bytes, but vanilla Relative.SET_STREAM_CODEC uses a four-byte integer. This leaves two bytes unconsumed and shifts onGround; the same pattern is repeated in the other five YAML files. Please reuse the existing PositionUpdateRelatives bitflags/u32 representation and rebuild the JSON. Validate the complete packet, including a nonzero high flag, rather than interpreting the trailing bytes as an extension.
Skills used: prismarine-protocol-data-review checked the native wire width and packet boundary; prismarine-architecture-review identified the existing reusable type.
Fixes partial packet errors for
entity_teleporton versions 1.21.4 through 1.21.11 (reported in mineflayer#3759: "Chunk size is 67 but only 33 was read" on 1.21.8).The packet structure changed in 1.21.2 (per minecraft.wiki Synchronize Vehicle Position and confirmed against the NeoForge 1.21.5 javadoc for
ClientboundTeleportEntityPacket): yaw/pitch became f32 (previously i8), and three newvelocityX/Y/Zdoubles plus a relative flags bitfield were added beforeonGround.Verification: the reporter's actual packet buffer (
768080808004c0...) previously decoded with only 33 of 67 bytes read; with this fix it decodes the full vanilla structure (entityId,x/y/z,velocityX/Y/Z,yaw/pitch,flags,onGround) — the remaining 2 bytes are a non-standard server (Wolfx) extension.Complements PR #1154 (which covers 1.21.3) by applying the same fix to all later versions: 1.21.4, 1.21.5, 1.21.6, 1.21.8, 1.21.9, 1.21.11.
Verified: all 6 versions regenerate cleanly (yaml/json in sync); protocolSync passes.