mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-23 08:31:34 +01:00
Set minimum portal search radius to 8. Added config option.
https://github.com/BentoBoxWorld/BentoBox/issues/1747
This commit is contained in:
parent
2a1d9fcc61
commit
33b49a2349
@ -248,6 +248,11 @@ public class Settings implements ConfigObject {
|
||||
@ConfigEntry(path = "island.clear-radius", since = "1.6.0")
|
||||
private int clearRadius = 5;
|
||||
|
||||
@ConfigComment("Minimum nether portal search radius. This should not be less that 8 otherwise duplicate")
|
||||
@ConfigComment("portals can occur")
|
||||
@ConfigEntry(path = "island.portal-search-radius", since = "1.17.0")
|
||||
private int minPortalSearchRadius = 8;
|
||||
|
||||
@ConfigComment("Number of blocks to paste per tick when pasting blueprints.")
|
||||
@ConfigComment("Smaller values will help reduce noticeable lag but will make pasting take slightly longer.")
|
||||
@ConfigComment("On the contrary, greater values will make pasting take less time, but this benefit is quickly severely impacted by the")
|
||||
@ -871,4 +876,18 @@ public class Settings implements ConfigObject {
|
||||
{
|
||||
this.ticksBetweenCalls = ticksBetweenCalls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the minPortalSearchRadius
|
||||
*/
|
||||
public int getMinPortalSearchRadius() {
|
||||
return minPortalSearchRadius;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param minPortalSearchRadius the minPortalSearchRadius to set
|
||||
*/
|
||||
public void setMinPortalSearchRadius(int minPortalSearchRadius) {
|
||||
this.minPortalSearchRadius = minPortalSearchRadius;
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,8 @@ public class PortalTeleportationListener implements Listener {
|
||||
// Find max x or max z
|
||||
int x = Math.abs(i.getProtectionCenter().getBlockX() - e.getFrom().getBlockX());
|
||||
int z = Math.abs(i.getProtectionCenter().getBlockZ() - e.getFrom().getBlockZ());
|
||||
int diff = i.getProtectionRange() - Math.max(x, z);
|
||||
int diff = Math.max(plugin.getSettings().getMinPortalSearchRadius(), i.getProtectionRange() - Math.max(x, z));
|
||||
BentoBox.getInstance().logDebug("Search radius = " + diff);
|
||||
if (diff > 0 && diff < 128) {
|
||||
e.setSearchRadius(diff);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# BentoBox v1.14.1-SNAPSHOT-LOCAL configuration file.
|
||||
# BentoBox {$version} configuration file.
|
||||
#
|
||||
# This configuration file contains settings that mainly apply to or manage the following elements:
|
||||
# * Data storage
|
||||
@ -58,6 +58,14 @@ general:
|
||||
# This helps prevent issues if the server crashes.
|
||||
# Data is also saved at important points in the game.
|
||||
backup-period: 5
|
||||
# How many players will be saved in one tick. Default is 200
|
||||
# Reduce if you experience lag while saving.
|
||||
# Do not set this too low or data might get lost!
|
||||
max-saved-players-per-tick: 20
|
||||
# How many islands will be saved in one tick. Default is 200
|
||||
# Reduce if you experience lag while saving.
|
||||
# Do not set this too low or data might get lost!
|
||||
max-saved-islands-per-tick: 20
|
||||
# Enable SSL connection to MongoDB, MariaDB, MySQL and PostgreSQL databases.
|
||||
# Added since 1.12.0.
|
||||
use-ssl: false
|
||||
@ -161,6 +169,10 @@ island:
|
||||
# Be careful not to make this too big. Does not cover standard nether or end teleports.
|
||||
# Added since 1.6.0.
|
||||
clear-radius: 5
|
||||
# Minimum nether portal search radius. This should not be less that 8 otherwise duplicate
|
||||
# can occur.
|
||||
# Added since 1.17.0.
|
||||
portal-search-radius: 8
|
||||
# Number of blocks to paste per tick when pasting blueprints.
|
||||
# Smaller values will help reduce noticeable lag but will make pasting take slightly longer.
|
||||
# On the contrary, greater values will make pasting take less time, but this benefit is quickly severely impacted by the
|
||||
|
Loading…
Reference in New Issue
Block a user