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,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