-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ChunkDataVersion issues with third party applications #1466
Fix ChunkDataVersion issues with third party applications #1466
Conversation
125e095
to
9f8d3a0
Compare
@@ -168,7 +169,8 @@ public synchronized boolean loadChunk(@NotNull Mutable<ChunkData> chunkData, int | |||
|
|||
surfaceTimestamp = dataTimestamp; | |||
version = chunkVersion(data); | |||
chunkData.set(this.world.createChunkData(chunkData.get(), data.get(DATAVERSION).intValue())); | |||
IntIntImmutablePair chunkBounds = inclusiveChunkBounds(data); | |||
chunkData.set(this.world.createChunkData(chunkData.get(), chunkBounds.leftInt(), chunkBounds.rightInt())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use yMin
and yMax
instead of parsing the chunk bounds on every chunk? Although we would probably need to test to see which one is faster.
This PR is somewhat difficult to test. We still have #1175 which may or may not be related which could be causing issues. There are certain moments when I can sometimes load 1 chunk or 20k chunks to the correct 0 to 320 height. Other times I can do 0 to 256. Retyping the Retyping the The Map view (max Map Y clip 320) gives an indication as to where terrain should be Map view with max Map Y clip at 256 shows that terrain in the preview is still cut at 256. |
The screenshots in the previous comment worried me so I didn't merge this PR yet. Are these issues caused by this PR or could this be merged? If this PR is fine, could you please rebase it, @NotStirred? 🙏 |
9f8d3a0
to
69d167d
Compare
… version. This fixes annoying ChunkDataVersion issues with third-party apps like WorldPainter
69d167d
to
611bd42
Compare
Some WorldPainter worlds have their ChunkDataVersion set to a version prior to minecraft's support for worlds with >=256 height.
This PR changes how we create
ChunkData
objects to be based on the actual block range found in a chunk, rather than its version