diff --git a/src/main/java/io/th0rgal/protectionlib/compatibilities/HuskClaimCompat.java b/src/main/java/io/th0rgal/protectionlib/compatibilities/HuskClaimCompat.java index 88d2e53..ae0ed1a 100644 --- a/src/main/java/io/th0rgal/protectionlib/compatibilities/HuskClaimCompat.java +++ b/src/main/java/io/th0rgal/protectionlib/compatibilities/HuskClaimCompat.java @@ -31,7 +31,7 @@ public boolean canBuild(Player player, Location target) { Position position = huskClaimsBukkit.getPosition(target); Optional trustLevel = huskClaimsBukkit.getTrustLevelAt(position, onlineUser); - return trustLevel.isPresent() && trustLevel.get().getFlags().contains(OperationType.BLOCK_PLACE); + return trustLevel.isEmpty() || trustLevel.get().getFlags().contains(OperationType.BLOCK_PLACE); } @Override @@ -40,7 +40,7 @@ public boolean canBreak(Player player, Location target) { Position position = huskClaimsBukkit.getPosition(target); Optional trustLevel = huskClaimsBukkit.getTrustLevelAt(position, onlineUser); - return trustLevel.isPresent() && trustLevel.get().getFlags().contains(OperationType.BLOCK_BREAK); + return trustLevel.isEmpty() || trustLevel.get().getFlags().contains(OperationType.BLOCK_BREAK); } @Override @@ -50,7 +50,7 @@ public boolean canInteract(Player player, Location target) { OperationType operationType = target.getBlock().getType().isBlock() ? OperationType.BLOCK_INTERACT : OperationType.ENTITY_INTERACT; Optional trustLevel = huskClaimsBukkit.getTrustLevelAt(position, onlineUser); - return trustLevel.isPresent() && trustLevel.get().getFlags().contains(operationType); + return trustLevel.isEmpty() || trustLevel.get().getFlags().contains(operationType); } @Override @@ -59,6 +59,6 @@ public boolean canUse(Player player, Location target) { Position position = huskClaimsBukkit.getPosition(target); Optional trustLevel = huskClaimsBukkit.getTrustLevelAt(position, onlineUser); - return trustLevel.isPresent() && trustLevel.get().getFlags().contains(OperationType.BLOCK_INTERACT); + return trustLevel.isEmpty() || trustLevel.get().getFlags().contains(OperationType.BLOCK_INTERACT); } }