From d71c0e86d757bc238846ceb53c2a12d8dbdc22b0 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 24 Mar 2011 15:49:33 +0100 Subject: [PATCH] bugfix - admins could not place signs etc in safezones --- plugin.yml | 2 +- .../factions/listeners/FactionsBlockListener.java | 1 + .../factions/listeners/FactionsPlayerListener.java | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index 7f628b2c..5532bbbe 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: Factions -version: 1.1 +version: 1.1.1 main: com.bukkit.mcteam.factions.Factions commands: f: diff --git a/src/com/bukkit/mcteam/factions/listeners/FactionsBlockListener.java b/src/com/bukkit/mcteam/factions/listeners/FactionsBlockListener.java index 72f0e97e..61cb137b 100644 --- a/src/com/bukkit/mcteam/factions/listeners/FactionsBlockListener.java +++ b/src/com/bukkit/mcteam/factions/listeners/FactionsBlockListener.java @@ -102,6 +102,7 @@ public class FactionsBlockListener extends BlockListener { Faction myFaction = me.getFaction(); Faction otherFaction = Board.getFactionAt(new FLocation(block)); + // In safe zones you may use any block... if (otherFaction.isNormal() && myFaction != otherFaction) { me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction)); return false; diff --git a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java index c746e27a..946c7305 100644 --- a/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/com/bukkit/mcteam/factions/listeners/FactionsPlayerListener.java @@ -159,11 +159,20 @@ public class FactionsPlayerListener extends PlayerListener{ } FPlayer me = FPlayer.get(player); + + if (otherFaction.isSafeZone()) { + if (Factions.hasPermManageSafeZone(player)) { + return true; + } + me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a safe zone."); + return false; + } + Faction myFaction = me.getFaction(); // Cancel if we are not in our own territory if (myFaction != otherFaction) { - me.sendMessage("You can't use that in the territory of "+otherFaction.getTag(myFaction)); + me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction)); return false; }