bugfix - admins could not place signs etc in safezones

This commit is contained in:
Olof Larsson 2011-03-24 15:49:33 +01:00
parent fdd8a89327
commit d71c0e86d7
3 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,5 @@
name: Factions name: Factions
version: 1.1 version: 1.1.1
main: com.bukkit.mcteam.factions.Factions main: com.bukkit.mcteam.factions.Factions
commands: commands:
f: f:

View File

@ -102,6 +102,7 @@ public class FactionsBlockListener extends BlockListener {
Faction myFaction = me.getFaction(); Faction myFaction = me.getFaction();
Faction otherFaction = Board.getFactionAt(new FLocation(block)); Faction otherFaction = Board.getFactionAt(new FLocation(block));
// In safe zones you may use any block...
if (otherFaction.isNormal() && myFaction != otherFaction) { if (otherFaction.isNormal() && myFaction != otherFaction) {
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" 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; return false;

View File

@ -159,11 +159,20 @@ public class FactionsPlayerListener extends PlayerListener{
} }
FPlayer me = FPlayer.get(player); 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(); Faction myFaction = me.getFaction();
// Cancel if we are not in our own territory // Cancel if we are not in our own territory
if (myFaction != otherFaction) { 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; return false;
} }