From ad0791566465e7f95656b2c90887684254584265 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 24 Jul 2018 20:38:46 -0400 Subject: [PATCH] Fix /rsc in admin claims (#300) * Fix restrictsubclaim in admin claims * Allow players with /ignoreclaims on to toggle restrictsubclaim flag --- .../me/ryanhamshire/GriefPrevention/GriefPrevention.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index b80ef8e..6ef2fc4 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -1718,7 +1718,10 @@ public class GriefPrevention extends JavaPlugin return true; } - if(!player.getUniqueId().equals(claim.parent.ownerID)) + // If player has /ignoreclaims on, continue + // If admin claim, fail if this user is not an admin + // If not an admin claim, fail if this user is not the owner + if(!playerData.ignoreClaims && (claim.isAdminClaim() ? !player.hasPermission("griefprevention.adminclaims") : !player.getUniqueId().equals(claim.parent.ownerID))) { GriefPrevention.sendMessage(player, TextMode.Err, Messages.OnlyOwnersModifyClaims, claim.getOwnerName()); return true;