Add warzoneDenyCommands.
This commit is contained in:
parent
a4a11e7045
commit
bee36f5ba0
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user