Fix for DenyUsage checks in safe zones and war zones not being handled properly

This commit is contained in:
Brettflan 2011-06-16 02:37:05 -05:00
parent db0e89fb11
commit e886cef9aa
2 changed files with 7 additions and 11 deletions

View File

@ -74,16 +74,15 @@ public class FactionsBlockListener extends BlockListener {
me.sendMessage("You can't "+action+" in the wilderness.");
return false;
}
if (otherFaction.isSafeZone()) {
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
else if (otherFaction.isSafeZone()) {
if (!Conf.safeZoneDenyBuild || Factions.hasPermManageSafeZone(player)) {
return true;
}
me.sendMessage("You can't "+action+" in a safe zone.");
return false;
}
else if (otherFaction.isWarZone()) {
if (Factions.hasPermManageWarZone(player) || !Conf.warZoneDenyBuild) {
if (!Conf.warZoneDenyBuild || Factions.hasPermManageWarZone(player)) {
return true;
}
me.sendMessage("You can't "+action+" in a war zone.");

View File

@ -233,8 +233,6 @@ public class FactionsPlayerListener extends PlayerListener{
return; // only interested on right-clicks for below
}
// this check below might no longer be needed... bucket detection is now necessarily handled separately in onPlayerBucketXXX() events, and
// Flint&Steel is somehow detected before this in onBlockPlace(), and that's currently it for the default territoryDenyUseageMaterials
if ( ! this.playerCanUseItemHere(player, block, event.getMaterial())) {
event.setCancelled(true);
return;
@ -268,16 +266,15 @@ public class FactionsPlayerListener extends PlayerListener{
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the wilderness.");
return false;
}
if (otherFaction.isSafeZone() && Conf.safeZoneDenyUseage) {
if (Factions.hasPermManageSafeZone(player)) {
else if (otherFaction.isSafeZone()) {
if (!Conf.safeZoneDenyUseage || Factions.hasPermManageSafeZone(player)) {
return true;
}
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a safe zone.");
return false;
}
else if (otherFaction.isWarZone() && Conf.warZoneDenyUseage) {
if (Factions.hasPermManageWarZone(player)) {
else if (otherFaction.isWarZone()) {
if (!Conf.warZoneDenyUseage || Factions.hasPermManageWarZone(player)) {
return true;
}
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a war zone.");