mirror of
https://github.com/plexusorg/Plex.git
synced 2024-10-31 17:17:12 +00:00
Use PlexUtils.mmDeserialize instead of MiniMessage.miniMessage().deserialize in ChatListener
This commit is contained in:
parent
7d0f3618c9
commit
8592978be2
@ -4,7 +4,7 @@ import dev.plex.cache.PlayerCache;
|
|||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
import dev.plex.listener.annotation.Toggleable;
|
import dev.plex.listener.annotation.Toggleable;
|
||||||
import dev.plex.player.PlexPlayer;
|
import dev.plex.player.PlexPlayer;
|
||||||
import dev.plex.util.PlexLog;
|
import dev.plex.util.PlexUtils;
|
||||||
import io.papermc.paper.chat.ChatRenderer;
|
import io.papermc.paper.chat.ChatRenderer;
|
||||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||||
import net.kyori.adventure.audience.Audience;
|
import net.kyori.adventure.audience.Audience;
|
||||||
@ -15,7 +15,6 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
|||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
|
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
|
||||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -67,14 +66,14 @@ public class ChatListener extends PlexListener
|
|||||||
return Component.empty()
|
return Component.empty()
|
||||||
.append(prefix)
|
.append(prefix)
|
||||||
.append(Component.space())
|
.append(Component.space())
|
||||||
.append(MiniMessage.miniMessage().deserialize(plugin.config.getString("chat.name-color", "<white>") + MiniMessage.builder().tags(TagResolver.resolver(StandardTags.color(), StandardTags.rainbow(), StandardTags.decorations(), StandardTags.gradient(), StandardTags.transition())).build().serialize(sourceDisplayName)))
|
.append(PlexUtils.mmDeserialize(plugin.config.getString("chat.name-color", "<white>") + MiniMessage.builder().tags(TagResolver.resolver(StandardTags.color(), StandardTags.rainbow(), StandardTags.decorations(), StandardTags.gradient(), StandardTags.transition())).build().serialize(sourceDisplayName)))
|
||||||
.append(Component.space())
|
.append(Component.space())
|
||||||
.append(Component.text("»").color(NamedTextColor.GRAY))
|
.append(Component.text("»").color(NamedTextColor.GRAY))
|
||||||
.append(Component.space())
|
.append(Component.space())
|
||||||
.append(message);
|
.append(message);
|
||||||
}
|
}
|
||||||
return Component.empty()
|
return Component.empty()
|
||||||
.append(MiniMessage.miniMessage().deserialize(plugin.config.getString("chat.name-color", "<white>") + MiniMessage.builder().tags(TagResolver.resolver(StandardTags.color(), StandardTags.rainbow(), StandardTags.decorations(), StandardTags.gradient(), StandardTags.transition())).build().serialize(sourceDisplayName)))
|
.append(PlexUtils.mmDeserialize(plugin.config.getString("chat.name-color", "<white>") + MiniMessage.builder().tags(TagResolver.resolver(StandardTags.color(), StandardTags.rainbow(), StandardTags.decorations(), StandardTags.gradient(), StandardTags.transition())).build().serialize(sourceDisplayName)))
|
||||||
.append(Component.space())
|
.append(Component.space())
|
||||||
.append(Component.text("»").color(NamedTextColor.GRAY))
|
.append(Component.text("»").color(NamedTextColor.GRAY))
|
||||||
.append(Component.space())
|
.append(Component.space())
|
||||||
|
Loading…
Reference in New Issue
Block a user