Spawn Point doesn't include Y coord
Technoturnovers opened this issue ยท 2 comments
In vanilla, the spawning mechanism takes Y coords for world spawn simply as a suggestion, and in Cubic Chunks this means that a player could spawn anywhere where there is generated land at any Y coord. I suggest making the game force World Spawn to be exact coordinates, or make Y coord take a higher priority than in vanilla.
I just took a look at the spawn point finding in SpawnPlaceFinder which generates a random-ish x/z spot (in a specified range) and finds the top block in that spot. I guess that's what causes this issue, in Worlds with extreme cliffs etc, this may lead to massive height differences of spawn points.
Depending on runtime, it could be possible to check the Column's (or the chunk's, if that works, so we don't need to cast into an interface) BlockPos getPrecipitationHeight method and generate a spawn point in an area of for example +/- 1 cube (vertical) (for example by generating a new one if the criteria is not met, though that would be horribly inefficient).
Sady the documentation says this method is a little buggy, but using it instead of finding the column's top block, this will avoid spawning people on floating islands.