public String allowBreak(Player player, Location location) { PlayerData playerData = this.dataStore.getPlayerData(player.getName()); Claim claim = this.dataStore.getClaimAt(location, false, playerData.lastClaim); WorldConfig wc = GriefPrevention.instance.getWorldCfg(player.getWorld()); // exception: administrators in ignore claims mode, and special player accounts created by // server mods if (playerData.ignoreClaims || wc.getModsIgnoreClaimsAccounts().contains(player.getName())) return null; // wilderness rules if (claim == null) { // no building in the wilderness in creative mode if (this.creativeRulesApply(location)) { String reason = this.dataStore.getMessage(Messages.NoBuildOutsideClaims) + " " + this.dataStore.getMessage(Messages.CreativeBasicsDemoAdvertisement); if (player.hasPermission("griefprevention.ignoreclaims")) reason += " " + this.dataStore.getMessage(Messages.IgnoreClaimsAdvertisement); return reason; } else if (wc.getApplyTrashBlockRules() && wc.getClaimsEnabled()) { return this.dataStore.getMessage(Messages.NoBuildOutsideClaims) + " " + this.dataStore.getMessage(Messages.SurvivalBasicsDemoAdvertisement); } // but it's fine in survival mode else { return null; } } else { // cache the claim for later reference playerData.lastClaim = claim; // if not in the wilderness, then apply claim rules (permissions, etc) return claim.allowBreak(player, location.getBlock()); } }