Only mods and higher should use Mod Chat Channel
This commit is contained in:
parent
1ac9c123d0
commit
d6d8031804
@ -37,8 +37,12 @@ public class CmdChat extends FCommand {
|
||||
|
||||
if (modeString != null) {
|
||||
modeString = modeString.toLowerCase();
|
||||
if (modeString.startsWith("m")) {
|
||||
// Only allow Mods and higher rank to switch to this channel.
|
||||
if (modeString.startsWith("m") && fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
modeTarget = ChatMode.MOD;
|
||||
} else if (modeString.startsWith("m") && !fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
msg(TL.COMMAND_CHAT_MOD_ONLY);
|
||||
return;
|
||||
} else if (modeString.startsWith("p")) {
|
||||
modeTarget = ChatMode.PUBLIC;
|
||||
} else if (modeString.startsWith("a")) {
|
||||
|
@ -63,8 +63,14 @@ public class FactionsChatListener implements Listener {
|
||||
fplayer.sendMessage("[MCspy]: " + message);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Just in case player gets demoted while in faction chat.
|
||||
me.msg(TL.COMMAND_CHAT_MOD_ONLY);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Bukkit.getLogger().log(Level.INFO, ChatColor.stripColor("Mod Chat: " + message));
|
||||
|
||||
event.setCancelled(true);
|
||||
|
@ -188,6 +188,7 @@ public enum TL {
|
||||
COMMAND_CHAT_MODE_TRUCE("&c&l[!] &5Truce &7only chat mode."),
|
||||
COMMAND_CHAT_MODE_FACTION("&c&l[!] &aFaction&7 only chat mode."),
|
||||
COMMAND_CHAT_MODE_MOD("&c&l[!] &dMod &7only chat mode."),
|
||||
COMMAND_CHAT_MOD_ONLY("&c&l[!] &7Only Mods can talk through this chat mode."),
|
||||
|
||||
COMMAND_CHATSPY_ENABLE("&c&l[!] &7You have &cenabled &7chat spying mode."),
|
||||
COMMAND_CHATSPY_ENABLELOG(" has ENABLED chat spying mode."),
|
||||
|
Loading…
Reference in New Issue
Block a user