Fix mute bypasses via clans chat commands

This commit is contained in:
AlexTheCoder 2017-06-15 23:05:41 -04:00
parent fc3a4bdbfe
commit e8a4e23f05
2 changed files with 24 additions and 1 deletions

View File

@ -2,10 +2,13 @@ package mineplex.game.clans.clans.commands;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.command.CommandBase; import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.punish.Punish;
import mineplex.core.punish.PunishClient;
import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.ClansManager;
@ -39,7 +42,16 @@ public class ClansAllyChatCommand extends CommandBase<ClansManager>
{ {
ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller); ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller);
if (clan == null) UtilPlayer.message(caller, F.main("Clans", "You are not in a Clan.")); if (clan == null) UtilPlayer.message(caller, F.main("Clans", "You are not in a Clan."));
else Plugin.chatAlly(clan, caller, F.combine(args, 0, null, false)); else
{
PunishClient punishClient = Managers.get(Punish.class).GetClient(caller.getName());
if (punishClient != null && punishClient.IsMuted())
{
UtilPlayer.message(caller, F.main("Clans", "You cannot do this while muted!"));
return;
}
Plugin.chatAlly(clan, caller, F.combine(args, 0, null, false));
}
} }
} }
} }

View File

@ -2,10 +2,13 @@ package mineplex.game.clans.clans.commands;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.command.CommandBase; import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.punish.Punish;
import mineplex.core.punish.PunishClient;
import mineplex.game.clans.clans.ClanInfo; import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.clans.ClansManager;
@ -41,7 +44,15 @@ public class ClansChatCommand extends CommandBase<ClansManager>
if (clan == null) if (clan == null)
UtilPlayer.message(caller, F.main("Clans", "You are not in a Clan.")); UtilPlayer.message(caller, F.main("Clans", "You are not in a Clan."));
else else
{
PunishClient punishClient = Managers.get(Punish.class).GetClient(caller.getName());
if (punishClient != null && punishClient.IsMuted())
{
UtilPlayer.message(caller, F.main("Clans", "You cannot do this while muted!"));
return;
}
Plugin.chatClan(clan, caller, F.combine(args, 0, null, false)); Plugin.chatClan(clan, caller, F.combine(args, 0, null, false));
}
} }
} }
} }