mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-05 18:40:06 +01:00
Ensure maxEverProtectionRange is less than range.
https://github.com/BentoBoxWorld/BentoBox/issues/1851
This commit is contained in:
parent
3dd9e973fb
commit
7271096ace
@ -561,6 +561,9 @@ public class Island implements DataObject, MetaDataAble {
|
||||
* @return the maxEverProtectionRange or the protection range, whichever is larger
|
||||
*/
|
||||
public int getMaxEverProtectionRange() {
|
||||
if (maxEverProtectionRange > this.range) {
|
||||
maxEverProtectionRange = this.range;
|
||||
}
|
||||
return Math.max(protectionRange, maxEverProtectionRange);
|
||||
}
|
||||
|
||||
@ -569,6 +572,9 @@ public class Island implements DataObject, MetaDataAble {
|
||||
*/
|
||||
public void setMaxEverProtectionRange(int maxEverProtectionRange) {
|
||||
this.maxEverProtectionRange = maxEverProtectionRange;
|
||||
if (maxEverProtectionRange > this.range) {
|
||||
maxEverProtectionRange = this.range;
|
||||
}
|
||||
setChanged();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user