Skip to content

Conversation

@PierreSchwang
Copy link
Member

@PierreSchwang PierreSchwang commented Aug 24, 2025

Overview

Fixes #4552
Fixes #4708

Description

NBT format changed in the last few versions. Now uses the native methods "provided" by minecraft to set data via the original NBT data.

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@github-actions github-actions bot added the Bugfix This PR fixes a bug label Aug 24, 2025
@PierreSchwang
Copy link
Member Author

PierreSchwang commented Aug 30, 2025

I've attempted to use the native NMS methods for loading and updating the block states, which seems to work partially.
Only tested in 1.21.8 with FAWE, so there are still quite a few tests left. The only thing I've noticed is, that signs don't seem to get their lines / info set. Containers (Chests, Lecterns), Banners, Skulls work perfectly.

Performance-wise it doesn't seem too bad. It'll be slower than the previous approach ig, but based on my testing the mean duration for a tile entity update (tag conversion, loading + updating) was roughly 500μs (lowest being like 50μs, and highest 10ms). I could do some additional benchmarks with the previous logic ig. But as it does not work 100% yet and is quite untested, I've not prioritized that high yet.

EDIT: Signs don't work because the methods applying the NBT data require the SignEntity to be related to a ServerLevel, which there isn't in WorldGen / block population. Will see how I can workaround that

@github-actions
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

@PierreSchwang PierreSchwang force-pushed the fix/generatorBlockNbtPopulation branch from ba8d8a5 to 8002d17 Compare October 20, 2025 22:05
@PierreSchwang PierreSchwang marked this pull request as ready for review October 24, 2025 20:35
@PierreSchwang PierreSchwang requested a review from a team as a code owner October 24, 2025 20:35
@PierreSchwang
Copy link
Member Author

I've tested with a few tile entities (and extensively with signs) - everything seems to work so far (except one thing on a spigot server, where some sign lines were just raw JSON - but I feel like the schematic is kinda broken). But I would appreciate further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inventory in schem map aren't successfully pasted into plots World-Generator banner / skull meta not set.

3 participants