fix: skip unrecognized block IDs in client plan deserialization#12244
Merged
Conversation
Prevent NullPointerException when a client sends a plan with a block ID the server doesn't recognize (e.g. from a modded client). Skip the plan entry instead of crashing. Fixes Anuken#12243
Owner
|
On second thought, this behavior should probably not be 'fixed'. The alternative is the client having a block they can never build, and the server silently letting them sit like that. This is not acceptable. In addition, clients shouldn't be able to build blocks the server doesn't recognize. This points to an incorrect version check, or the client installing mods that incorrectly have server compatibility set to true. |
3 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.
When a client with a content mismatch sends a ClientPlanSnapshotCallPacket containing a block ID the server does not recognize, Vars.content.block() returns null. The null block is then accessed for .rotate, causing a NullPointerException that drops the client connection.
Skip unrecognized block plan entries instead of crashing.
Fixes #12243