mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Move the chat renderer to a final class variable instead of initializing it every chat event
This commit is contained in:
parent
8202021f07
commit
15f0f5fe2d
@ -18,11 +18,12 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
public class ChatListener extends PlexListener
|
public class ChatListener extends PlexListener
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private final PlexChatRenderer renderer = new PlexChatRenderer();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChat(AsyncChatEvent event)
|
public void onChat(AsyncChatEvent event)
|
||||||
{
|
{
|
||||||
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(event.getPlayer().getUniqueId());
|
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(event.getPlayer().getUniqueId());
|
||||||
PlexChatRenderer renderer = new PlexChatRenderer();
|
|
||||||
|
|
||||||
if (!plexPlayer.getPrefix().isEmpty())
|
if (!plexPlayer.getPrefix().isEmpty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user