Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add territoryTruceDenyCommands to configuration #282

Open
wants to merge 1 commit into
base: 1.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/massivecraft/factions/Conf.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public class Conf {
public static Set<String> permanentFactionMemberDenyCommands = new LinkedHashSet<>();
// commands which will be prevented when in claimed territory of another faction
public static Set<String> territoryNeutralDenyCommands = new LinkedHashSet<>();
public static Set<String> territoryTruceDenyCommands = new LinkedHashSet<>();
public static Set<String> territoryEnemyDenyCommands = new LinkedHashSet<>();
public static Set<String> territoryAllyDenyCommands = new LinkedHashSet<>();
public static Set<String> warzoneDenyCommands = new LinkedHashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ public static boolean preventCommand(String fullCmd, Player player) {
return true;
}

if (at.isNormal() && rel.isTruce() && !Conf.territoryTruceDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryTruceDenyCommands.iterator())) {
me.msg(TL.PLAYER_COMMAND_TRUCE, fullCmd);
return true;
}

if (at.isNormal() && rel.isNeutral() && !Conf.territoryNeutralDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryNeutralDenyCommands.iterator())) {
me.msg(TL.PLAYER_COMMAND_NEUTRAL, fullCmd);
return true;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/massivecraft/factions/zcore/util/TL.java
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,7 @@ public enum TL {
PLAYER_COMMAND_ENEMY("You can't use the command '%s' in enemy territory."),
PLAYER_COMMAND_PERMANENT("You can't use the command '%s' because you are in a permanent faction."),
PLAYER_COMMAND_ALLY("You can't use the command '%s' in ally territory."),
PLAYER_COMMAND_TRUCE("You can't use the command '%s' in truce territory."),
PLAYER_COMMAND_WILDERNESS("You can't use the command '%s' in the wilderness."),

PLAYER_POWER_NOLOSS_PEACEFUL("You didn't lose any power since you are in a peaceful faction."),
Expand Down