[0.15.33] Spawn location not affected by on_chunk_generated
Posted: Tue Aug 29, 2017 3:03 pm
While modding i accidentially replaced most of the spawn area with water in an on_chunk_generated event. Spawning as a corpse when after starting in a new world. After pressing "continue" (Singleplayer) and waiting for the respawn i was standing on my corpse alive - very much to my suprise.
1) The game generates the chunk containing {0,0}
2) The game checks if {0,0} is a valid spawn point
3) The game notices that {0,0} is NOT a valid spawn point (water, stones (?))
4) The game sets a new spawn point in the vicinity
5) My mod changes the chunk in on_chunk_generated
6) The game doesn't recheck if the spawn point still has land and spawns me on a water tile
7) I die.
Expected behavior:
Check 2) only after all mods events in 5) are done. I guess?
Addendum:
I'm not sure if would be my mods resposibility in that case to put the spawn point somewhere else. So i'm kinda posting this for completitions sake.
Picture
As my mod still has land at {0,0} and i can't seem to reproduce this by randomly restarting the world i suspect the following order of events:1) The game generates the chunk containing {0,0}
2) The game checks if {0,0} is a valid spawn point
3) The game notices that {0,0} is NOT a valid spawn point (water, stones (?))
4) The game sets a new spawn point in the vicinity
5) My mod changes the chunk in on_chunk_generated
6) The game doesn't recheck if the spawn point still has land and spawns me on a water tile
7) I die.
Expected behavior:
Check 2) only after all mods events in 5) are done. I guess?
Addendum:
I'm not sure if would be my mods resposibility in that case to put the spawn point somewhere else. So i'm kinda posting this for completitions sake.