diff --git a/Essentials/Patches/ChatMessagePatch.cs b/Essentials/Patches/ChatMessagePatch.cs index 07135c4..b4eb2fa 100644 --- a/Essentials/Patches/ChatMessagePatch.cs +++ b/Essentials/Patches/ChatMessagePatch.cs @@ -44,13 +44,16 @@ public static void Patch(PatchContext ctx) { } private static bool OnChatMessageReceived_Server(ref ChatMsg msg) { - var Account = PlayerAccountData.GetAccount(msg.Author); - if (Account != null) { - var Rank = RanksAndPermissions.GetRankData(Account.Rank); - if (Rank.DisplayPrefix) { - msg.Author = 0; - msg.CustomAuthorName = $"{Rank.Prefix}{Account.Player}"; + if (EssentialsPlugin.Instance.Config.EnableRanks) { + var Account = PlayerAccountData.GetAccount(msg.Author); + if (Account != null) { + var Rank = RanksAndPermissions.GetRankData(Account.Rank); + if (Rank.DisplayPrefix) { + msg.Author = 0; + msg.CustomAuthorName = $"{Rank.Prefix}{Account.Player}"; + } } + return true; } return true; }