mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Use plain instead of legacy for chat event format
This commit is contained in:
1 parent
68a1086613
commit
5adbb5332d
2 files changed
+3
-1
No files matched your search
@@ -50,6 +50,7 @@ dependencies {
|
||||
compile 'net.kyori:adventure-nbt:4.0.0-SNAPSHOT'
|
||||
compile 'net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT'
|
||||
compile 'net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT'
|
||||
compile 'net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT'
|
||||
compile 'de.themoep:minedown-adventure:1.6.1-SNAPSHOT'
|
||||
|
||||
compile 'net.kyori:event-api:3.0.0'
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.draycia.carbon.channels.ChatChannel;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -81,7 +82,7 @@ public class BukkitChatListener implements Listener {
|
||||
final Component component = selectedChannel.sendMessage(user, recipients, event.getMessage(), false);
|
||||
|
||||
if (!component.equals(TextComponent.empty())) {
|
||||
event.setFormat(CarbonChat.LEGACY.serialize(component)
|
||||
event.setFormat(PlainComponentSerializer.plain().serialize(component)
|
||||
.replaceAll("(?:[^%]|\\A)%(?:[^%]|\\z)", "%%"));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user