bedrock: fix camera_instruction fade structure (time_data/color_rgb optional prefixes) 1.20.30+ - #1246
Open
AnonymoDGH wants to merge 1 commit into
Open
bedrock: fix camera_instruction fade structure (time_data/color_rgb optional prefixes) 1.20.30+#1246AnonymoDGH wants to merge 1 commit into
AnonymoDGH wants to merge 1 commit into
Conversation
…rgb are optional with bool prefix (1.20.30+)
Member
|
Thanks |
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.
Fixes #1109
Root cause: In
packet_camera_instruction, thefadeinstruction was defined without the optional prefixes that each of its fields has on the wire. Per pmmp/BedrockProtocol,CameraFadeInstructionis:Optional<CameraFadeTimeData>(bool + 3×f32) followed byOptional<CameraFadeInstructionColor>(bool + 3×f32 RGB).minecraft-data had:
which misses the two per-field presence booleans, so any real-world packet using both time and color fails to parse (
PartialReadErroron all versions from 1.20.30).Fix (all versions 1.20.30 → latest):
Verification: the reporter's 34-byte sample (
rAIAAAEBAAAAPwAAwD8AAAA/AeHgYD3BwMA90dBQPgAAAA==, pid 300) previously failed with PartialReadError on every version; with this fix it decodes fully (34/34 bytes) via protodef:{"name":"camera_instruction","params":{"fade":{"time_data":{"fade_in_duration":0.5,"wait_duration":1.5,"fade_out_duration":0.5},"color_rgb":{"red":0.05490196,"green":0.09411764,"blue":0.20392157}}}}All affected protocol.json files regenerated via
compileProtocol.js.