Move the chat renderer to a final class variable instead of initializing it every chat event

This commit is contained in:
spacerocket62 2022-01-27 01:03:48 -08:00
parent 8202021f07
commit 15f0f5fe2d

View File

@ -18,11 +18,12 @@ import org.jetbrains.annotations.NotNull;
public class ChatListener extends PlexListener
{
private final PlexChatRenderer renderer = new PlexChatRenderer();
@EventHandler
public void onChat(AsyncChatEvent event)
{
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(event.getPlayer().getUniqueId());
PlexChatRenderer renderer = new PlexChatRenderer();
if (!plexPlayer.getPrefix().isEmpty())
{