From f96d62aa058600bcde8720e1c0e4134f86247f0e Mon Sep 17 00:00:00 2001 From: Shane Bee Date: Wed, 9 Jan 2019 15:50:21 -0800 Subject: [PATCH] Config to allow fire spread and damage within claims (#445) --- .../GriefPrevention/BlockEventHandler.java | 2 ++ .../GriefPrevention/GriefPrevention.java | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java index 25df55d..c326582 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java @@ -661,6 +661,7 @@ public class BlockEventHandler implements Listener //never spread into a claimed area, regardless of settings if(this.dataStore.getClaimAt(spreadEvent.getBlock().getLocation(), false, null) != null) { + if(GriefPrevention.instance.config_claims_firespreads) return; spreadEvent.setCancelled(true); //if the source of the spread is not fire on netherrack, put out that source fire to save cpu cycles @@ -714,6 +715,7 @@ public class BlockEventHandler implements Listener //never burn claimed blocks, regardless of settings if(this.dataStore.getClaimAt(burnEvent.getBlock().getLocation(), false, null) != null) { + if(GriefPrevention.instance.config_claims_firedamages) return; burnEvent.setCancelled(true); } } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 1e44b13..664f5fb 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -133,6 +133,9 @@ public class GriefPrevention extends JavaPlugin 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 int config_claims_manualDeliveryDelaySeconds; //how long to wait before giving a book to a new player + + public boolean config_claims_firespreads; //whether fire will spread in claims + public boolean config_claims_firedamages; //whether fire will damage in claims 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 @@ -582,7 +585,10 @@ public class GriefPrevention extends JavaPlugin 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_claims_firespreads = config.getBoolean("GriefPrevention.Claims.FireSpreadsInClaims", false); + this.config_claims_firedamages = config.getBoolean("GriefPrevention.Claims.FireDamagesInClaims", false); + this.config_spam_enabled = config.getBoolean("GriefPrevention.Spam.Enabled", true); this.config_spam_loginCooldownSeconds = config.getInt("GriefPrevention.Spam.LoginCooldownSeconds", 60); this.config_spam_loginLogoutNotificationsPerMinute = config.getInt("GriefPrevention.Spam.LoginLogoutNotificationsPerMinute", 5); @@ -831,7 +837,10 @@ public class GriefPrevention extends JavaPlugin 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.Claims.FireSpreadsInClaims", config_claims_firespreads); + outConfig.set("GriefPrevention.Claims.FireDamagesInClaims", config_claims_firedamages); + outConfig.set("GriefPrevention.Spam.Enabled", this.config_spam_enabled); outConfig.set("GriefPrevention.Spam.LoginCooldownSeconds", this.config_spam_loginCooldownSeconds); outConfig.set("GriefPrevention.Spam.LoginLogoutNotificationsPerMinute", this.config_spam_loginLogoutNotificationsPerMinute);