Skip to content

Fix BlockData merge for cached states - #14080

Merged
lynxplay merged 1 commit into
PaperMC:mainfrom
ZapolyarnyDev:fix/block-data-merge-for-cached-state
Jul 26, 2026
Merged

Fix BlockData merge for cached states#14080
lynxplay merged 1 commit into
PaperMC:mainfrom
ZapolyarnyDev:fix/block-data-merge-for-cached-state

Conversation

@ZapolyarnyDev

@ZapolyarnyDev ZapolyarnyDev commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #14064

Retain parsedStates for preloaded BlockData cache entries. This allows merge to correctly handle fully specified string-created BlockData
I also added regression tests covering banners and oak logs

@ZapolyarnyDev
ZapolyarnyDev requested a review from a team as a code owner July 18, 2026 22:15
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Jul 18, 2026
@ZapolyarnyDev
ZapolyarnyDev force-pushed the fix/block-data-merge-for-cached-state branch from c422bee to 152e7ed Compare July 18, 2026 22:25
@papermc-projects papermc-projects Bot moved this from Awaiting review to Full approval in Paper PR Queue Jul 21, 2026

@Owen1212055 Owen1212055 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix!

@lynxplay
lynxplay merged commit 2d76c9c into PaperMC:main Jul 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Full approval to Merged in Paper PR Queue Jul 26, 2026
hershate added a commit to hershate/Papo that referenced this pull request Jul 27, 2026
Cached default-state CraftBlockData instances had parsedStates == null,
so BlockData#merge threw 'Data not created via string parsing' even for
BlockData obtained via string parsing (e.g. Server#createBlockData).

Adapted to 1.21.11 where parsedStates is a Map (upstream 26.1 uses
List<Property.Value>) and newData is named fromString upstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

BlockData#merge not working properly

4 participants