Only even numbers in island size

This commit is contained in:
Fabrizio La Rosa 2020-07-06 09:29:55 +02:00
parent 7cff7893b8
commit 122aea1bba
2 changed files with 17 additions and 3 deletions

View File

@ -65,6 +65,10 @@ public class Island {
if (this.size > 1000) {
this.size = 50;
}
if(this.size % 2 != 0) {
this.size += 1;
}
if (player.isOnline()) {
int customSize = PlayerUtils.getNumberFromPermission(player.getPlayer(), "fabledskyblock.size", 0);
@ -77,8 +81,17 @@ public class Island {
if (minimumSize < 0 || minimumSize > 1000)
minimumSize = 50;
if(minimumSize % 2 != 0) {
minimumSize += 1;
}
if (maximumSize < 0 || maximumSize > 1000)
maximumSize = 100;
if(maximumSize % 2 != 0) {
maximumSize += 1;
}
size = Math.max(minimumSize, Math.min(customSize, maximumSize));
}

View File

@ -15,9 +15,10 @@ Island:
# You should increase this only if you have an SSD
ChunkPerTick: 15
Size:
# [!] Do not go over 1000 for both of these options.
# The size of an Island when created.
# [!] Do not go over the maximum.
# Warning: The maximum is capped at 1000
# Warning: Only even numbers are accepted
# Warning: Do not go over the maximum
# The size of an Island when created
Minimum: 100
# The maximum size of an Island based on the permission node 'fabledskyblock.size.<size>'.
Maximum: 200