Fix for DenyUsage checks in safe zones and war zones not being handled properly
This commit is contained in:
parent
db0e89fb11
commit
e886cef9aa
@ -74,16 +74,15 @@ public class FactionsBlockListener extends BlockListener {
|
|||||||
me.sendMessage("You can't "+action+" in the wilderness.");
|
me.sendMessage("You can't "+action+" in the wilderness.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if (otherFaction.isSafeZone()) {
|
||||||
if (otherFaction.isSafeZone()) {
|
if (!Conf.safeZoneDenyBuild || Factions.hasPermManageSafeZone(player)) {
|
||||||
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
me.sendMessage("You can't "+action+" in a safe zone.");
|
me.sendMessage("You can't "+action+" in a safe zone.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (otherFaction.isWarZone()) {
|
else if (otherFaction.isWarZone()) {
|
||||||
if (Factions.hasPermManageWarZone(player) || !Conf.warZoneDenyBuild) {
|
if (!Conf.warZoneDenyBuild || Factions.hasPermManageWarZone(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
me.sendMessage("You can't "+action+" in a war zone.");
|
me.sendMessage("You can't "+action+" in a war zone.");
|
||||||
|
@ -233,8 +233,6 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
return; // only interested on right-clicks for below
|
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())) {
|
if ( ! this.playerCanUseItemHere(player, block, event.getMaterial())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -268,16 +266,15 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the wilderness.");
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the wilderness.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if (otherFaction.isSafeZone()) {
|
||||||
if (otherFaction.isSafeZone() && Conf.safeZoneDenyUseage) {
|
if (!Conf.safeZoneDenyUseage || Factions.hasPermManageSafeZone(player)) {
|
||||||
if (Factions.hasPermManageSafeZone(player)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a safe zone.");
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a safe zone.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (otherFaction.isWarZone() && Conf.warZoneDenyUseage) {
|
else if (otherFaction.isWarZone()) {
|
||||||
if (Factions.hasPermManageWarZone(player)) {
|
if (!Conf.warZoneDenyUseage || Factions.hasPermManageWarZone(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a war zone.");
|
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in a war zone.");
|
||||||
|
Loading…
Reference in New Issue
Block a user