Fix player spawn sometimes chosen midair above cavern - #3550
Open
yel0h wants to merge 2 commits into
Open
Conversation
IntegratedQuantum
requested changes
Aug 23, 2026
IntegratedQuantum
left a comment
Member
There was a problem hiding this comment.
Ideally you should check the actual chunk(s) it's in, not just the CaveMap. Otherwise there may still be problem with structure generation (e.g. you might spawn in a tree, or in a lava lake or whatever)
Contributor
Author
|
Okay, now also checks whether the actual generated blocks are safe |
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.
isValidSpawnLocationnow also queries theCaveMapat the candidate column to confirm there's solid ground at the surface height and clear air above it to stand in, rejecting the candidate and letting the spiral search keep looking otherwise. Also made the 2D height calculation run when no valid location was found.Example test seed with this bug: 9071844392573517448
Fixes #2097