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); } }