From 4cee3b35b38b26f1100d9caf5a3b8b131688cd0f Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 21 Mar 2024 23:32:13 +0100 Subject: [PATCH] Modify permission check in GriefPreventionProtection Refactored the permission checks in GriefPreventionProtection.java to use the Inventory permission rather than the Access permission. This change is in the methods canInteract and canDamage, and as a result enhances their functionalities under GriefPrevention's claim-based protection system. --- .../yardwatch/hooks/GriefPreventionProtection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java b/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java index c66ed36..0c2384b 100644 --- a/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java +++ b/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java @@ -53,13 +53,13 @@ public class GriefPreventionProtection implements Protection { @Override public boolean canInteract(Player player, Entity target) { Claim claim = GriefPrevention.instance.dataStore.getClaimAt(target.getLocation(), true, null); - return claim == null || claim.hasExplicitPermission(player.getUniqueId(), ClaimPermission.Access); + return claim == null || claim.hasExplicitPermission(player.getUniqueId(), ClaimPermission.Inventory); // do not ask why it's "inventory"... } @Override public boolean canDamage(Entity damager, Entity target) { if (!(damager instanceof Player player)) return true; Claim claim = GriefPrevention.instance.dataStore.getClaimAt(target.getLocation(), true, null); - return claim == null || claim.hasExplicitPermission(player.getUniqueId(), ClaimPermission.Access); + return claim == null || claim.hasExplicitPermission(player.getUniqueId(), ClaimPermission.Inventory); // do not ask why it's "inventory"... } }