Skip to content

Fix NPE in dimension_type registry handler for MC 26.1.1#1242

Merged
kennytv merged 1 commit intoViaVersion:masterfrom
roggy666:master
Apr 7, 2026
Merged

Fix NPE in dimension_type registry handler for MC 26.1.1#1242
kennytv merged 1 commit intoViaVersion:masterfrom
roggy666:master

Conversation

@roggy666
Copy link
Copy Markdown
Contributor

@roggy666 roggy666 commented Apr 7, 2026

When a player using an older client (via ViaBackwards) connects to a 26.1.1 server, the REGISTRY_DATA packet is remapped by Protocol26_1To1_21_11. The dimension_type handler assumes every dimension entry contains an "attributes" CompoundTag and calls removeNamespaced() on it to strip new visual fields (block_light_tint, night_vision_color, ambient_light_color).

In 26.1.1 some dimension_type entries may not include the "attributes" tag at all, causing getCompoundTag("attributes") to return null. This results in a NullPointerException inside TagUtil.removeNamespaced, which crashes the encoder pipeline and disconnects the player with "Internal Exception: EncoderException".

Added a null check before calling removeNamespaced so that dimensions without the attributes tag are silently skipped.

Example of fixed error from my server with datapack for new dimension: https://pastebin.com/M9eCv3th

When a player using an older client (via ViaBackwards) connects to a
26.1.1 server, the REGISTRY_DATA packet is remapped by
Protocol26_1To1_21_11. The dimension_type handler assumes every
dimension entry contains an "attributes" CompoundTag and calls
removeNamespaced() on it to strip new visual fields
(block_light_tint, night_vision_color, ambient_light_color).

In 26.1.1 some dimension_type entries may not include the "attributes"
tag at all, causing getCompoundTag("attributes") to return null.
This results in a NullPointerException inside TagUtil.removeNamespaced,
which crashes the encoder pipeline and disconnects the player with
"Internal Exception: EncoderException".

Added a null check before calling removeNamespaced so that dimensions
without the attributes tag are silently skipped.
@kennytv kennytv merged commit 8c07e58 into ViaVersion:master Apr 7, 2026
1 check passed
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.

2 participants