From 8e28fe3270f3cd6fcac23f594c8a510644a3181a Mon Sep 17 00:00:00 2001 From: AlexDev_ <56083016+alexdev03@users.noreply.github.com> Date: Sun, 26 May 2024 17:27:44 +0200 Subject: [PATCH] Fixed problem with HuskClaims (#34) --- .../protectionlib/compatibilities/HuskClaimCompat.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); } }