Skip to content

fix: skip unrecognized block IDs in client plan deserialization#12244

Merged
Anuken merged 1 commit into
Anuken:masterfrom
dajiaohuang:fix/12243-null-block-npe
Jun 20, 2026
Merged

fix: skip unrecognized block IDs in client plan deserialization#12244
Anuken merged 1 commit into
Anuken:masterfrom
dajiaohuang:fix/12243-null-block-npe

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

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

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
@Anuken Anuken merged commit 7542587 into Anuken:master Jun 20, 2026
2 checks passed
@Anuken

Anuken commented Jun 21, 2026

Copy link
Copy Markdown
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.

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.

NullPointerException in TypeIO.readClientPlans when client sends unknown block ID

2 participants