From e8a4e23f05429d5816da6491765fc34b6eac8618 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Thu, 15 Jun 2017 23:05:41 -0400 Subject: [PATCH] Fix mute bypasses via clans chat commands --- .../clans/clans/commands/ClansAllyChatCommand.java | 14 +++++++++++++- .../clans/clans/commands/ClansChatCommand.java | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansAllyChatCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansAllyChatCommand.java index b1723b719..fdbd287a4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansAllyChatCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansAllyChatCommand.java @@ -2,10 +2,13 @@ package mineplex.game.clans.clans.commands; import org.bukkit.entity.Player; +import mineplex.core.Managers; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; 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.ClansManager; @@ -39,7 +42,16 @@ public class ClansAllyChatCommand extends CommandBase { ClanInfo clan = Plugin.getClanUtility().getClanByPlayer(caller); 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)); + } } } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansChatCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansChatCommand.java index 36619c1ef..3ce97064c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansChatCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/ClansChatCommand.java @@ -2,10 +2,13 @@ package mineplex.game.clans.clans.commands; import org.bukkit.entity.Player; +import mineplex.core.Managers; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.F; 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.ClansManager; @@ -41,7 +44,15 @@ public class ClansChatCommand extends CommandBase if (clan == null) UtilPlayer.message(caller, F.main("Clans", "You are not in a Clan.")); 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)); + } } } }