make chat listener not parse events

This commit is contained in:
Taah 2022-04-24 16:31:26 -07:00
parent bc3893e2db
commit 2bc943b4c8

View File

@ -10,6 +10,8 @@ import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor; 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.standard.StandardTags;
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;
@ -51,14 +53,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>"))).append(sourceDisplayName) .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(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>"))).append(sourceDisplayName) .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(Component.space()) .append(Component.space())
.append(Component.text("»").color(NamedTextColor.GRAY)) .append(Component.text("»").color(NamedTextColor.GRAY))
.append(Component.space()) .append(Component.space())