From 9e8376a6a64a8b4bbe6b4eb30c26d50c9fd0a171 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Wed, 13 Apr 2016 20:17:16 -0700 Subject: [PATCH] Fixed claims blocking build/break in worlds where claims are disabled. This may also improve performance for the block place/break events. If the world claims disable is permanent, server owners can use the new /DeleteClaimsInWorld command to conveniently delete all of them. --- src/me/ryanhamshire/GriefPrevention/GriefPrevention.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index e1517d3..ac9bd9b 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -3181,7 +3181,9 @@ public class GriefPrevention extends JavaPlugin public String allowBuild(Player player, Location location, Material material) { - PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); + if(!GriefPrevention.instance.claimsEnabledForWorld(location.getWorld())) return null; + + PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim); //exception: administrators in ignore claims mode and special player accounts created by server mods @@ -3226,7 +3228,9 @@ public class GriefPrevention extends JavaPlugin public String allowBreak(Player player, Block block, Location location) { - PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); + if(!GriefPrevention.instance.claimsEnabledForWorld(location.getWorld())) return null; + + PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim); //exception: administrators in ignore claims mode, and special player accounts created by server mods