Fix moderator chat

This commit is contained in:
Nathan Curran 2021-06-28 22:46:46 +10:00
parent 32afc7c1b2
commit 4ec00d977c
No known key found for this signature in database
GPG Key ID: B3A964B30C2E56B8
3 changed files with 15 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>me.totalfreedom</groupId>
<artifactId>TFGuilds</artifactId>
<version>2021.06-RC2</version>
<version>2021.06-RC3</version>
<packaging>jar</packaging>
<name>TFGuilds</name>

View File

@ -25,6 +25,12 @@ public class ModChatSubCommand extends Common implements SubCommand
return;
}
if (!guild.isModerator(playerSender))
{
sender.sendMessage(PREFIX + "You must be a guild moderator to set player's rank for your guild.");
return;
}
if (args.length == 1)
{
sender.sendMessage(USAGE + "/g mchat <message>");

View File

@ -820,7 +820,14 @@ public class Guild
{
if (User.getUserFromPlayer(p).displayChat() && isMember(p))
{
p.sendMessage(GUtil.colorize("&7[&bGuild " + (modChat ? "Mod " : "") + "Chat &7| &b" + name + "&7] " + player.getName() + " &8\u00BB &6") + message);
if (modChat && isModerator(p))
{
p.sendMessage(GUtil.colorize("&7[&bGuild Mod Chat &7| &b" + name + "&7] " + player.getName() + " &8\u00BB &6") + message);
}
else
{
p.sendMessage(GUtil.colorize("&7[&bGuild Chat &7| &b" + name + "&7] " + player.getName() + " &8\u00BB &6") + message);
}
}
if (Common.GUILD_CHAT_SPY.contains(p) && player != p && !isMember(p))