Fix NPE in dimension_type registry handler for MC 26.1.1#1242
Merged
kennytv merged 1 commit intoViaVersion:masterfrom Apr 7, 2026
Merged
Fix NPE in dimension_type registry handler for MC 26.1.1#1242kennytv merged 1 commit intoViaVersion:masterfrom
kennytv merged 1 commit intoViaVersion:masterfrom
Conversation
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
approved these changes
Apr 7, 2026
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 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