Skip to content

Commit e3b9919

Browse files
authored
Optimize safe location searching with configurable range limit (#1892)
* better safe spot finder * this should be better * limit how far the y-coordinate will be expanded * load chunks passively
1 parent ed50765 commit e3b9919

File tree

3 files changed

+146
-90
lines changed

3 files changed

+146
-90
lines changed

src/main/java/world/bentobox/bentobox/Settings.java

+15
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ public class Settings implements ConfigObject {
298298
@ConfigEntry(path = "island.deletion.keep-previous-island-on-reset", since = "1.13.0")
299299
private boolean keepPreviousIslandOnReset = false;
300300

301+
@ConfigComment("By default, If the destination is not safe, the plugin will try to search for a safe spot around the destination,")
302+
@ConfigComment("then it will try to expand the y-coordinate up and down from the destination.")
303+
@ConfigComment("This setting limits how far the y-coordinate will be expanded.")
304+
@ConfigComment("If set to 0 or lower, the plugin will not expand the y-coordinate.")
305+
@ConfigEntry(path = "island.safe-spot-search-vertical-range", since = "1.19.1")
306+
private int safeSpotSearchVerticalRange = 400;
307+
301308
/* WEB */
302309
@ConfigComment("Toggle whether BentoBox can connect to GitHub to get data about updates and addons.")
303310
@ConfigComment("Disabling this will result in the deactivation of the update checker and of some other")
@@ -890,4 +897,12 @@ public int getMinPortalSearchRadius() {
890897
public void setMinPortalSearchRadius(int minPortalSearchRadius) {
891898
this.minPortalSearchRadius = minPortalSearchRadius;
892899
}
900+
901+
public int getSafeSpotSearchVerticalRange() {
902+
return safeSpotSearchVerticalRange;
903+
}
904+
905+
public void setSafeSpotSearchVerticalRange(int safeSpotSearchVerticalRange) {
906+
this.safeSpotSearchVerticalRange = safeSpotSearchVerticalRange;
907+
}
893908
}

0 commit comments

Comments
 (0)