This commit is contained in:
parent
b71fec6329
commit
6a7e8b066a
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>cn.lunadeer</groupId>
|
<groupId>cn.lunadeer</groupId>
|
||||||
<artifactId>EssentialsD</artifactId>
|
<artifactId>EssentialsD</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>2.1.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>EssentialsD</name>
|
<name>EssentialsD</name>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
package cn.lunadeer.essentialsd.events;
|
package cn.lunadeer.essentialsd.events;
|
||||||
|
|
||||||
import cn.lunadeer.essentialsd.EssentialsD;
|
import cn.lunadeer.essentialsd.EssentialsD;
|
||||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
|
||||||
public class ChatPrefixEvent implements Listener {
|
public class ChatPrefixEvent implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChat(AsyncChatEvent event) {
|
public void onChat(AsyncPlayerChatEvent event) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
String formated = PlaceholderAPI.setPlaceholders(event.getPlayer(), EssentialsD.config.getPrefixFormat());
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user