diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java index ef762ac4..19b5756c 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java @@ -1,7 +1,6 @@ package me.totalfreedom.totalfreedommod; import com.google.common.base.Strings; -import io.papermc.paper.chat.ChatRenderer; import io.papermc.paper.event.player.AsyncChatEvent; import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.api.event.AdminChatEvent; @@ -9,7 +8,6 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.rank.Displayable; import me.totalfreedom.totalfreedommod.util.FUtil; -import net.kyori.adventure.audience.Audience; import net.kyori.adventure.key.Key; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; @@ -24,7 +22,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.jetbrains.annotations.NotNull; import java.util.Arrays; @@ -142,11 +139,13 @@ public class ChatManager extends FreedomService public void onAdminChat(AdminChatEvent event) { Displayable display = event.getDisplayable(); + String flatAbv = FUtil.miniMessage(display.getAbbr()); - Component defaultFormat = FUtil.miniMessage("[ADMIN] ]: ", + Component defaultFormat = FUtil.miniMessage("[ADMIN] []: ", Placeholder.component("prefix", event.getPrefix()), Placeholder.component("name", event.getName()), - Placeholder.component("tag", getColoredTag(display)), + Placeholder.unparsed("rank", flatAbv), + TagResolver.resolver("rankcolor", Tag.styling(getColor(display))), Placeholder.component("message", event.getMessage())); plugin.getComponentLogger().info(defaultFormat); @@ -157,7 +156,6 @@ public class ChatManager extends FreedomService if (!Strings.isNullOrEmpty(admin.getAcFormat())) { String format = admin.getAcFormat(); - String flatAbv = FUtil.miniMessage(display.getAbbr()); player.sendMessage(FUtil.miniMessage(format, Placeholder.component("prefix", event.getPrefix()), @@ -178,11 +176,6 @@ public class ChatManager extends FreedomService return display.getColor(); } - public Component getColoredTag(Displayable display) - { - return display.getColoredTag(); - } - public void adminChat(Component name, Displayable displayable, Component message, boolean async) { AdminChatEvent event = new AdminChatEvent(name, displayable, message, async); diff --git a/commons/src/main/java/me/totalfreedom/totalfreedommod/Muter.java b/commons/src/main/java/me/totalfreedom/totalfreedommod/Muter.java index 270b848c..9e3ada69 100644 --- a/commons/src/main/java/me/totalfreedom/totalfreedommod/Muter.java +++ b/commons/src/main/java/me/totalfreedom/totalfreedommod/Muter.java @@ -1,5 +1,6 @@ package me.totalfreedom.totalfreedommod; +import io.papermc.paper.event.player.AsyncChatEvent; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.util.FLog; @@ -27,7 +28,7 @@ public class Muter extends FreedomService } @EventHandler(priority = EventPriority.HIGHEST) - public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent event) + public void onAsyncPlayerChatEvent(AsyncChatEvent event) { Player player = event.getPlayer();