Repository navigation
fix: read lowercase entity "id" tag when loading disk clipboard - #3726
Open
intersecato wants to merge 1 commit into
Open
intersecato wants to merge 1 commit into
intersecato wants to merge 1 commit into
Conversation
MattBDev
approved these changes
Nov 12, 2026
SirYwell
reviewed
Nov 12, 2026
| return "illusioner"; | ||
| default: { | ||
| if (Character.isUpperCase(id.charAt(0))) { | ||
| if (!id.isEmpty() && Character.isUpperCase(id.charAt(0))) { |
Contributor
Author
There was a problem hiding this comment.
Why can this be the case?
CompoundTag#getString returns "" for a missing key. That's what caused #2494: there was only id, so getString("Id") returned "" and charAt(0) threw. The id fallback covers that case, but a tag with neither key would still crash. Other callers of parse (e.g. MutableEntityChange) could hit it too. It's just a defensive check, so I can drop it if you prefer.
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.
Overview
Players with a disk-saved clipboard containing entities get a
StringIndexOutOfBoundsExceptionon every join, because the stored entity NBT uses the vanilla lowercaseidtag that FAWE doesn't read. This PR makes FAWE accept bothIdandidand handle a missing id safely.Fixes #2494
Description
Entity NBT stored in a disk clipboard can carry the vanilla lowercase
idtag instead of FAWE's internalId.BaseEntity(CompoundTag)only readIdand got an empty string.EntityTypes.convertEntityIdthen threw aStringIndexOutOfBoundsExceptiononcharAt(0), so entity loading for the clipboard was aborted every time the player joined:Submitter Checklist
@since TODO.