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.
This commit is contained in:
ryanhamshire 2016-04-13 20:17:16 -07:00
parent 62b3c9098c
commit 9e8376a6a6

View File

@ -3181,6 +3181,8 @@ public class GriefPrevention extends JavaPlugin
public String allowBuild(Player player, Location location, Material material) public String allowBuild(Player player, Location location, Material material)
{ {
if(!GriefPrevention.instance.claimsEnabledForWorld(location.getWorld())) return null;
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim); Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim);
@ -3226,6 +3228,8 @@ public class GriefPrevention extends JavaPlugin
public String allowBreak(Player player, Block block, Location location) public String allowBreak(Player player, Block block, Location location)
{ {
if(!GriefPrevention.instance.claimsEnabledForWorld(location.getWorld())) return null;
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim); Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim);