From 78fbe3a3898ebd42c2c122318405873f56d9e477 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Tue, 15 Dec 2015 13:57:08 -0800 Subject: [PATCH] Config option for claim book delivery timing. --- src/me/ryanhamshire/GriefPrevention/GriefPrevention.java | 5 ++++- src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 0c02ec0..11edfa1 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -113,7 +113,8 @@ public class GriefPrevention extends JavaPlugin public Material config_claims_modificationTool; //which material will be used to create/resize claims with a right click public ArrayList config_claims_commandsRequiringAccessTrust; //the list of slash commands requiring access trust when in a claim - public boolean config_claims_supplyPlayerManual; //whether to give new players a book with land claim help in it + public boolean config_claims_supplyPlayerManual; //whether to give new players a book with land claim help in it + public int config_claims_manualDeliveryDelaySeconds; //how long to wait before giving a book to a new player public ArrayList config_siege_enabledWorlds; //whether or not /siege is enabled on this server public ArrayList config_siege_blocks; //which blocks will be breakable in siege mode @@ -523,6 +524,7 @@ public class GriefPrevention extends JavaPlugin this.config_claims_villagerTradingRequiresTrust = config.getBoolean("GriefPrevention.Claims.VillagerTradingRequiresPermission", true); String accessTrustSlashCommands = config.getString("GriefPrevention.Claims.CommandsRequiringAccessTrust", "/sethome"); this.config_claims_supplyPlayerManual = config.getBoolean("GriefPrevention.Claims.DeliverManuals", true); + this.config_claims_manualDeliveryDelaySeconds = config.getInt("GriefPrevention.Claims.ManualDeliveryDelaySeconds", 30); this.config_spam_enabled = config.getBoolean("GriefPrevention.Spam.Enabled", true); this.config_spam_loginCooldownSeconds = config.getInt("GriefPrevention.Spam.LoginCooldownSeconds", 60); @@ -754,6 +756,7 @@ public class GriefPrevention extends JavaPlugin outConfig.set("GriefPrevention.Claims.VillagerTradingRequiresPermission", this.config_claims_villagerTradingRequiresTrust); outConfig.set("GriefPrevention.Claims.CommandsRequiringAccessTrust", accessTrustSlashCommands); outConfig.set("GriefPrevention.Claims.DeliverManuals", config_claims_supplyPlayerManual); + outConfig.set("GriefPrevention.Claims.ManualDeliveryDelaySeconds", config_claims_manualDeliveryDelaySeconds); outConfig.set("GriefPrevention.Spam.Enabled", this.config_spam_enabled); outConfig.set("GriefPrevention.Spam.LoginCooldownSeconds", this.config_spam_loginCooldownSeconds); diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 8f6b829..ba80310 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -779,7 +779,7 @@ class PlayerEventHandler implements Listener if(GriefPrevention.instance.config_claims_worldModes.get(player.getWorld()) == ClaimsMode.Survival && !player.hasPermission("griefprevention.adminclaims") && this.dataStore.claims.size() > 10) { WelcomeTask task = new WelcomeTask(player); - Bukkit.getScheduler().scheduleSyncDelayedTask(GriefPrevention.instance, task, 2400L); //2 minutes after join + Bukkit.getScheduler().scheduleSyncDelayedTask(GriefPrevention.instance, task, GriefPrevention.instance.config_claims_manualDeliveryDelaySeconds * 20L); } }