Change how spawn & death positions are tracked by Player
#6552
Labels
Category: Core
Related to internal functionality
Easy task
Probably really easy to do, good task for first-time contributors
Type: Cleanup
Removes or deprecates API methods or behaviour
Type: Enhancement
Contributes features or other improvements to PocketMine-MP
Problem description
Currently we need some clunky hacks to avoid returning
Position
containing unloaded worlds.Proposed solution
Since we don't actually need the
World
instance untilgetSpawn()
orgetDeathPosition()
are actually called, it would probably make more sense to store a foldername + Vector3, and then create aPosition
just-in-time whengetSpawn()
orgetDeathPosition()
are called. This would also permit spawn & death positions in unloaded worlds to be saved irrespective of whether the target world is loaded, allowing the world to be later reloaded without breaking runtimePosition
s that we didn't actually need anyway.Related to #5502
This is (mostly) non-BC breaking. It would only affect custom
Player
classes, so it would probably be OK to make a change like this inminor-next
.The text was updated successfully, but these errors were encountered: