-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Optimize safe location searching with configurable range limit #1892
Conversation
Updated the description |
This is great! Just out of interest, why have a variable as a configuration? Why not just boolean and yes/no it? Or why have this option at all? I'd say the job of safe search is to find a spot, not need for config. What do you think? |
src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java
Show resolved
Hide resolved
This is to fix a weird case in CaveBlock. When the server owner changes the world depth lower than the default height, the check may cause the players to go to the roof of that world. |
And I want to archive a behavior that if a safe spot was not found, it would create a spot for the players instead of throwing them to the roof. |
Since there are a lot of GameModes with different kind of Game Worlds, this setting may need to leave for the owners to decide. |
Much better. It'll check the current chunk before loading the next one, all async now. |
This new method will search the spot around the destination, and then expand the y-coordinate up and down, instead of the old method (searching top-down).
This fixes a weird behavior in CaveBlock where the players sometimes go straight to the roof (Close #1891).
A new setting is also added to limit the y-coordinate range, which optimizes the searching a bit.