Skip to content

Fix server compatibility: use modern post-1.18 chunk format - #855

Merged
louis-e merged 4 commits into
mainfrom
fix/server-compatible-chunk-format
Apr 1, 2026
Merged

louis-e merged 4 commits into
mainfrom
fix/server-compatible-chunk-format

Conversation

@louis-e

@louis-e louis-e commented Mar 28, 2026 •

Copy link
Copy Markdown
Owner

Arnis-generated worlds appeared empty on servers (PaperMC, etc.) because chunks used the deprecated pre-1.18 Level wrapper format and were missing critical metadata. Servers don't auto-repair chunks like the singleplayer client does, so they treated the chunks as corrupt/ungenerated.

Changes:

  • Remove Level compound wrapper, write chunk data at root level
  • Add DataVersion (3955/MC 1.21.1), Status ("minecraft:full"), yPos (-4)
  • Emit all 24 sections (Y=-4 to Y=19) with biomes, not just sections with blocks
  • Compute MOTION_BLOCKING/WORLD_SURFACE/OCEAN_FLOOR heightmaps from block data
  • Add required empty structures, PostProcessing, block_ticks, fluid_ticks
  • Set isLightOn=1, InhabitedTime=0, LastUpdate=0

Copilot AI review requested due to automatic review settings March 28, 2026 11:46
@github-actions

github-actions Bot commented Mar 28, 2026 •

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 34s
🧠 Peak memory usage: 1115 MB

📈 Compared against baseline: 30s
🧮 Delta: 4s
🔢 Commit: 3a317b4

🟢 Generation time is unchanged.

📅 Last benchmark: 2026-03-31 18:53:41 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Java Anvil chunk serialization to the modern (post-1.18) root-level chunk NBT layout to improve dedicated server compatibility (e.g., PaperMC), addressing cases where servers treat generated chunks as ungenerated/corrupt.

Changes:

  • Switch chunk NBT output from the deprecated Level wrapper to root-level fields (e.g., DataVersion, Status, yPos).
  • Emit a full vertical section set (24 sections) and add required chunk metadata scaffolding (structures, ticks, post-processing).
  • Add computed heightmaps to the written chunk NBT.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/world_editor/java.rs
Comment thread src/world_editor/java.rs Outdated
Comment thread src/world_editor/java.rs Outdated
Comment thread src/world_editor/java.rs
Comment thread src/world_editor/java.rs
Arnis-generated worlds appeared empty on servers (PaperMC, etc.) because
chunks used the deprecated pre-1.18 Level wrapper format and were missing
critical metadata. Servers don't auto-repair chunks like the singleplayer
client does, so they treated the chunks as corrupt/ungenerated.

Changes:
- Remove Level compound wrapper, write chunk data at root level
- Add DataVersion (3955/MC 1.21.1), Status ("minecraft:full"), yPos (-4)
- Emit all 24 sections (Y=-4 to Y=19) with biomes, not just sections with blocks
- Compute MOTION_BLOCKING/WORLD_SURFACE/OCEAN_FLOOR heightmaps from block data
- Add required empty structures, PostProcessing, block_ticks, fluid_ticks
- Set isLightOn=1, InhabitedTime=0, LastUpdate=0

Fixes #844

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@louis-e
louis-e force-pushed the fix/server-compatible-chunk-format branch from 5c9bad1 to 4c32a1f Compare March 28, 2026 12:04
@louis-e
louis-e requested a review from Copilot March 28, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/world_editor/java.rs
Comment thread src/world_editor/java.rs
Comment thread src/world_editor/java.rs Outdated
@djredflame

Copy link
Copy Markdown

PR #855 validation report

I tested PR #855 (Fix server compatibility: use modern post-1.18 chunk format) on my local stack and it appears to fix the original Java/Paper world-compatibility problem that I was seeing.

Test environment

  • Arnis: local build including PR Fix server compatibility: use modern post-1.18 chunk format #855
  • Base upstream version before applying the PR: v2.5.1
  • Minecraft server: Paper 1.21.11
  • Java runtime image used by server tooling: itzg/minecraft-server:java25
  • World flow tested:
    • generate Arnis world
    • start Paper server
    • verify whether prime-world / repair-world are still needed
    • inspect resulting chunk NBT
    • validate with my local quick-check scripts

Important caveat:
This means the PR works on my setup. It does not prove that it works in every environment, every Paper build, or every Minecraft version. But on my stack, the difference is very clear and reproducible.


What was broken before

Older Arnis-generated Java worlds on my side produced chunk NBT that looked like this:

  • root keys only:
    • isLightOn
    • sections
    • xPos
    • zPos

Typical missing fields in raw old worlds:

  • DataVersion
  • Status
  • Heightmaps
  • structures
  • yPos
  • section biomes

Example old raw worlds checked:

  • Arnis World 11
  • Arnis World 12
  • Arnis World 14

Validation results for old raw worlds:

  • Arnis World 11: generated quick-check OK, primed-format quick-check FAIL
  • Arnis World 12: generated quick-check FAIL, primed-format quick-check FAIL
  • Arnis World 14: generated quick-check OK, primed-format quick-check FAIL

Typical primed-format failure on old worlds:

  • chunk-root-still-minimal
  • missing-data-version
  • missing-heightmaps
  • missing-status
  • missing-biomes

So the old issue was real on my side: the raw Java output was too minimal for direct modern Paper use.


What changed with PR #855

After rebuilding Arnis with PR #855, newly generated worlds looked fundamentally different.

Representative new chunk structure now contains fields like:

  • DataVersion
  • Status
  • Heightmaps
  • structures
  • PostProcessing
  • block_ticks
  • fluid_ticks
  • yPos
  • section biomes

This is exactly the category of metadata that was missing before.

Representative example from a new generated world:

  • Status = minecraft:full
  • DataVersion = 3955 or later after Paper touches it
  • Heightmaps present
  • structures present
  • biomes present across the emitted sections
  • full vertical section range emitted instead of the old minimal section set

New-world test results

I generated and tested these new worlds with the patched build:

  • paris_test
  • test_pr855
  • hawaii_small
  • tokyo_small
  • london_small
  • london_small2

Primed-format quick-check results:

  • paris_test: OK
  • test_pr855: OK
  • hawaii_small: OK
  • tokyo_small: OK
  • london_small: FAIL
  • london_small2: OK

So on my side, 5 out of 6 newly generated test worlds passed directly.


Important nuance about the one failure

london_small still failed, but for a different reason:

  • failure: too-few-non-air-sections

That world still had the new modern chunk format:

  • DataVersion present
  • Status present
  • Heightmaps present
  • structures present
  • biomes present

So this does not look like the old server-compatibility issue anymore.
It looks more like a very small / thin BBOX edge case, not the original broken Java chunk format problem.


Runtime behavior on Paper

This was the most important practical result for me:

With the new worlds generated from the patched Arnis build, I no longer saw the old behavior where Paper had to rely on expensive fallback preparation for every new map.

In multiple cases:

  • no prime-world
  • no repair-world
  • server started directly
  • world loaded correctly in Paper

That is the behavior I originally wanted.


Side-by-side summary

Old raw Arnis output

  • minimal chunk root
  • missing DataVersion
  • missing Status
  • missing Heightmaps
  • missing structures
  • missing section biomes
  • not reliably direct-loadable on my Paper setup

New output with PR #855

  • modern post-1.18 chunk structure
  • DataVersion present
  • Status present
  • Heightmaps present
  • structures present
  • section biomes present
  • directly usable on my Paper 1.21.11 setup in most tested cases

Conclusion

On my local stack, PR #855 appears to fix the original Paper/Java compatibility issue.

More specifically:

  • it fixes the old minimal Java chunk NBT problem
  • newly generated worlds are now generally direct-loadable in Paper
  • the old prime/repair fallback is no longer needed for most of my test worlds
  • the remaining failure I found looks like a small-BBOX/content-density edge case, not the original chunk-format issue

So my conclusion is:

PR #855 solves the main issue for me on Paper 1.21.11, but I would still describe it as “confirmed on my environment”, not “universally confirmed everywhere”.

@djredflame

Copy link
Copy Markdown

PR #855: Chunk Validation Re-Review (Large Maps)
I re-tested PR #855 with larger maps, generated without subsurface-fill (so missing-subsurface-fill is expected and not problematic).

The only validation issues reported are:

missing-heightmaps
too-few-non-air-sections
Both are not blocking—worlds load and run fine in Paper.
Just noting these for completeness; everything else works as expected until now, will check it more out

Avoids recomputing has_air, bits_per_block, values_per_long, and mask
for the same section on every (x,z) column iteration. Precomputes all
section metadata once and sorts by Y descending for the top-down scan.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@louis-e

louis-e commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

1 similar comment
@louis-e

louis-e commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

@louis-e

louis-e commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

2 similar comments
@louis-e

louis-e commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

@louis-e

louis-e commented Mar 31, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/world_editor/java.rs
Comment thread src/world_editor/java.rs Outdated
Comment thread src/world_editor/java.rs Outdated
Comment thread src/world_editor/java.rs Outdated
- Set isLightOn=0 (no light arrays emitted, server computes lighting)
- Derive PostProcessing length from sections.len()
- Rename level_data -> chunk_nbt for clarity
- Fix doc comment to list all four heightmap types

Co-Authored-By: Claude Opus 4.6 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@louis-e
louis-e merged commit 684cc6f into main Apr 1, 2026
5 of 6 checks passed
@louis-e
louis-e deleted the fix/server-compatible-chunk-format branch April 1, 2026 14:35
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.

3 participants