mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-28 22:57:31 +02:00
Require non null getCenter
This will throw a big runtime error if range is adjusted without a center location being defined. Should only affect addons like the Converter.
This commit is contained in:
parent
17af44e67a
commit
982dc2fd52
@ -9,6 +9,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -919,7 +920,7 @@ public class Island implements DataObject, MetaDataAble {
|
|||||||
public void updateMaxEverProtectionRange() {
|
public void updateMaxEverProtectionRange() {
|
||||||
// Ratchet up the maximum protection range
|
// Ratchet up the maximum protection range
|
||||||
// Distance from maxes
|
// Distance from maxes
|
||||||
int diffMinX = Math.abs(getCenter().getBlockX() - this.getMinProtectedX());
|
int diffMinX = Math.abs(Objects.requireNonNull(getCenter()).getBlockX() - this.getMinProtectedX());
|
||||||
int diffMaxX = Math.abs(getCenter().getBlockX() - this.getMaxProtectedX());
|
int diffMaxX = Math.abs(getCenter().getBlockX() - this.getMaxProtectedX());
|
||||||
int diffMinZ = Math.abs(getCenter().getBlockZ() - this.getMinProtectedZ());
|
int diffMinZ = Math.abs(getCenter().getBlockZ() - this.getMinProtectedZ());
|
||||||
int diffMaxZ = Math.abs(getCenter().getBlockZ() - this.getMaxProtectedZ());
|
int diffMaxZ = Math.abs(getCenter().getBlockZ() - this.getMaxProtectedZ());
|
||||||
|
Loading…
Reference in New Issue
Block a user