Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how spawn & death positions are tracked by Player #6552

Open
dktapps opened this issue Dec 2, 2024 · 0 comments
Open

Change how spawn & death positions are tracked by Player #6552

dktapps opened this issue Dec 2, 2024 · 0 comments
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

Comments

@dktapps
Copy link
Member

dktapps commented Dec 2, 2024

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 until getSpawn() or getDeathPosition() are actually called, it would probably make more sense to store a foldername + Vector3, and then create a Position just-in-time when getSpawn() or getDeathPosition() 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 runtime Positions 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 in minor-next.

@dktapps dktapps added Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP Type: Cleanup Removes or deprecates API methods or behaviour Easy task Probably really easy to do, good task for first-time contributors labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant