unify usafe of util methods

This commit is contained in:
destro174
2021-08-25 22:11:29 +02:00
parent 2f8a8fc8ff
commit 0199a67e77
4 changed files with 8 additions and 21 deletions
@@ -255,17 +255,7 @@ public class ChatHandler {
private boolean isMuted(Player player, String message, String prefix) {
if (Database.get().isPlayerMuted(player.getUniqueId(), null) || (ChatPlugin.getInstance().serverMuted() && !player.hasPermission("chat.bypass-server-muted"))) {
MiniMessage miniMessage = MiniMessage.get();
Component blockedNotification = miniMessage.parse("<red>" + prefix
+ Utility.getDisplayName(player.getUniqueId(), player.getName())
+ " tried to say: "
+ message + "</red>");
Bukkit.getOnlinePlayers().forEach(a ->{
if (a.hasPermission("chat.alert-blocked")) {
a.sendMessage(blockedNotification);//TODO make configurable (along with all the messages)
}
});
GalaxyUtility.sendBlockedNotification(prefix, player, message, "");
return true;
}
return false;