diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index a6f60da..1e45845 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -70,6 +70,7 @@ public class GriefPrevention extends JavaPlugin public boolean config_claims_preventTheft; //whether containers and crafting blocks are protectable public boolean config_claims_protectCreatures; //whether claimed animals may be injured by players without permission public boolean config_claims_protectFires; //whether open flint+steel flames should be protected - optional because it's expensive + public boolean config_claims_protectHorses; //whether horses on a claim should be protected by that claim's rules public boolean config_claims_preventButtonsSwitches; //whether buttons and switches are protectable public boolean config_claims_lockWoodenDoors; //whether wooden doors should be locked by default (require /accesstrust) public boolean config_claims_lockTrapDoors; //whether trap doors should be locked by default (require /accesstrust) @@ -454,6 +455,7 @@ public class GriefPrevention extends JavaPlugin this.config_claims_preventTheft = config.getBoolean("GriefPrevention.Claims.PreventTheft", true); this.config_claims_protectCreatures = config.getBoolean("GriefPrevention.Claims.ProtectCreatures", true); this.config_claims_protectFires = config.getBoolean("GriefPrevention.Claims.ProtectFires", false); + this.config_claims_protectHorses = config.getBoolean("GriefPrevention.Claims.ProtectHorses", true); this.config_claims_preventButtonsSwitches = config.getBoolean("GriefPrevention.Claims.PreventButtonsSwitches", true); this.config_claims_lockWoodenDoors = config.getBoolean("GriefPrevention.Claims.LockWoodenDoors", false); this.config_claims_lockTrapDoors = config.getBoolean("GriefPrevention.Claims.LockTrapDoors", false); @@ -701,6 +703,7 @@ public class GriefPrevention extends JavaPlugin outConfig.set("GriefPrevention.Claims.LockFenceGates", this.config_claims_lockFenceGates); outConfig.set("GriefPrevention.Claims.EnderPearlsRequireAccessTrust", this.config_claims_enderPearlsRequireAccessTrust); outConfig.set("GriefPrevention.Claims.ProtectFires", this.config_claims_protectFires); + outConfig.set("GriefPrevention.Claims.ProtectHorses", this.config_claims_protectHorses); outConfig.set("GriefPrevention.Claims.InitialBlocks", this.config_claims_initialBlocks); outConfig.set("GriefPrevention.Claims.BlocksAccruedPerHour", this.config_claims_blocksAccruedPerHour); outConfig.set("GriefPrevention.Claims.MaxAccruedBlocks", this.config_claims_maxAccruedBlocks); diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 50f7c9a..2b1811f 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -42,6 +42,7 @@ import org.bukkit.entity.Boat; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.Hanging; +import org.bukkit.entity.Horse; import org.bukkit.entity.Player; import org.bukkit.entity.Vehicle; import org.bukkit.entity.minecart.PoweredMinecart; @@ -811,8 +812,9 @@ class PlayerEventHandler implements Listener if(!GriefPrevention.instance.claimsEnabledForWorld(entity.getWorld())) return; - PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); - + //allow horse protection to be overridden to allow management from other plugins + if (!GriefPrevention.instance.config_claims_protectHorses && entity instanceof Horse) return; + //don't allow interaction with item frames in claimed areas without build permission if(entity instanceof Hanging) { @@ -825,6 +827,8 @@ class PlayerEventHandler implements Listener } } + PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); + //don't allow container access during pvp combat if((entity instanceof StorageMinecart || entity instanceof PoweredMinecart)) {