From 21df6290dfdc50d03e3d8a8fc9b018f9789ff9c9 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Thu, 16 Jul 2015 19:26:41 -0700 Subject: [PATCH] Chest-based claims for non-survival worlds. Players may now create their first land claims in creative mode or survival-requiring-claims mode worlds by placing chests. --- .../GriefPrevention/GriefPrevention.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 37fdc55..cf3a2e7 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -2804,11 +2804,19 @@ public class GriefPrevention extends JavaPlugin //no building in the wilderness in creative mode if(this.creativeRulesApply(location) || this.config_claims_worldModes.get(location.getWorld()) == ClaimsMode.SurvivalRequiringClaims) { - String reason = this.dataStore.getMessage(Messages.NoBuildOutsideClaims); - if(player.hasPermission("griefprevention.ignoreclaims")) - reason += " " + this.dataStore.getMessage(Messages.IgnoreClaimsAdvertisement); - reason += " " + this.dataStore.getMessage(Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); - return reason; + //exception: when chest claims are enabled, players who have zero land claims and are placing a chest + if(material != Material.CHEST || playerData.getClaims().size() > 0 || GriefPrevention.instance.config_claims_automaticClaimsForNewPlayersRadius == -1) + { + String reason = this.dataStore.getMessage(Messages.NoBuildOutsideClaims); + if(player.hasPermission("griefprevention.ignoreclaims")) + reason += " " + this.dataStore.getMessage(Messages.IgnoreClaimsAdvertisement); + reason += " " + this.dataStore.getMessage(Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); + return reason; + } + else + { + return null; + } } //but it's fine in survival mode