Skip to content

Commit

Permalink
Optimize safe location searching with configurable range limit (#1892)
Browse files Browse the repository at this point in the history
* better safe spot finder

* this should be better

* limit how far the y-coordinate will be expanded

* load chunks passively
  • Loading branch information
HSGamer committed Dec 20, 2021
1 parent ed50765 commit e3b9919
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 90 deletions.
15 changes: 15 additions & 0 deletions src/main/java/world/bentobox/bentobox/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ public class Settings implements ConfigObject {
@ConfigEntry(path = "island.deletion.keep-previous-island-on-reset", since = "1.13.0")
private boolean keepPreviousIslandOnReset = false;

@ConfigComment("By default, If the destination is not safe, the plugin will try to search for a safe spot around the destination,")
@ConfigComment("then it will try to expand the y-coordinate up and down from the destination.")
@ConfigComment("This setting limits how far the y-coordinate will be expanded.")
@ConfigComment("If set to 0 or lower, the plugin will not expand the y-coordinate.")
@ConfigEntry(path = "island.safe-spot-search-vertical-range", since = "1.19.1")
private int safeSpotSearchVerticalRange = 400;

/* WEB */
@ConfigComment("Toggle whether BentoBox can connect to GitHub to get data about updates and addons.")
@ConfigComment("Disabling this will result in the deactivation of the update checker and of some other")
Expand Down Expand Up @@ -890,4 +897,12 @@ public int getMinPortalSearchRadius() {
public void setMinPortalSearchRadius(int minPortalSearchRadius) {
this.minPortalSearchRadius = minPortalSearchRadius;
}

public int getSafeSpotSearchVerticalRange() {
return safeSpotSearchVerticalRange;
}

public void setSafeSpotSearchVerticalRange(int safeSpotSearchVerticalRange) {
this.safeSpotSearchVerticalRange = safeSpotSearchVerticalRange;
}
}

0 comments on commit e3b9919

Please sign in to comment.