CubicChunks

CubicChunks

840k Downloads

Spawn Point doesn't include Y coord

Technoturnovers opened this issue ยท 2 comments

commented

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.

commented

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.

commented

Spawn point searchng should work now and should include Y coord. If it's not suitable a different one will be used.

Spawn point can be used if it's a solid block with 32 empty blocks above it.