Add warzoneDenyCommands.

This commit is contained in:
drtshock 2015-01-22 20:41:05 -06:00
parent a4a11e7045
commit bee36f5ba0
2 changed files with 7 additions and 1 deletions

View File

@ -145,6 +145,7 @@ public class Conf {
// commands which will be prevented when in claimed territory of another faction
public static Set<String> territoryNeutralDenyCommands = new LinkedHashSet<String>();
public static Set<String> territoryEnemyDenyCommands = new LinkedHashSet<String>();
public static Set<String> warzoneDenyCommands = new LinkedHashSet<String>();
public static double territoryShieldFactor = 0.3;
public static boolean territoryDenyBuild = true;

View File

@ -466,7 +466,7 @@ public class FactionsPlayerListener implements Listener {
}
public static boolean preventCommand(String fullCmd, Player player) {
if ((Conf.territoryNeutralDenyCommands.isEmpty() && Conf.territoryEnemyDenyCommands.isEmpty() && Conf.permanentFactionMemberDenyCommands.isEmpty())) {
if ((Conf.territoryNeutralDenyCommands.isEmpty() && Conf.territoryEnemyDenyCommands.isEmpty() && Conf.permanentFactionMemberDenyCommands.isEmpty() && Conf.warzoneDenyCommands.isEmpty())) {
return false;
}
@ -510,6 +510,11 @@ public class FactionsPlayerListener implements Listener {
return true;
}
if(Board.getInstance().getFactionAt(new FLocation(me)).isWarZone() && !Conf.warzoneDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.warzoneDenyCommands.iterator())) {
me.msg("<b>You can't use the command \"" + fullCmd + "\" in warzone.");
return true;
}
return false;
}