From 6a7e8b066ab64057486316033bc63917f873f3fe Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Sun, 11 Aug 2024 11:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BA=86=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../cn/lunadeer/essentialsd/events/ChatPrefixEvent.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index bdda6b6..6ce2c4b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.lunadeer EssentialsD - 2.1.0 + 2.1.1 jar EssentialsD diff --git a/src/main/java/cn/lunadeer/essentialsd/events/ChatPrefixEvent.java b/src/main/java/cn/lunadeer/essentialsd/events/ChatPrefixEvent.java index b9b68ab..43b2f6d 100644 --- a/src/main/java/cn/lunadeer/essentialsd/events/ChatPrefixEvent.java +++ b/src/main/java/cn/lunadeer/essentialsd/events/ChatPrefixEvent.java @@ -1,19 +1,19 @@ package cn.lunadeer.essentialsd.events; import cn.lunadeer.essentialsd.EssentialsD; -import io.papermc.paper.event.player.AsyncChatEvent; import me.clip.placeholderapi.PlaceholderAPI; -import net.kyori.adventure.text.Component; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.player.AsyncPlayerChatEvent; public class ChatPrefixEvent implements Listener { @EventHandler - public void onChat(AsyncChatEvent event) { + public void onChat(AsyncPlayerChatEvent event) { event.setCancelled(true); String formated = PlaceholderAPI.setPlaceholders(event.getPlayer(), EssentialsD.config.getPrefixFormat()); - EssentialsD.instance.getServer().sendMessage(Component.text(formated).append(event.message())); + formated += event.getMessage(); + EssentialsD.instance.getServer().broadcastMessage(formated); } }