From e66b81ba8975f2ed24da06a96007920616d0f181 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:56:47 +0200 Subject: [PATCH] synchronize while iterating syncronizedList in CommandSend --- .../java/net/md_5/bungee/module/cmd/send/CommandSend.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java index 01cab61072..e7af0d78dc 100644 --- a/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java +++ b/module/cmd-send/src/main/java/net/md_5/bungee/module/cmd/send/CommandSend.java @@ -50,8 +50,12 @@ public void lastEntryDone() ComponentBuilder builder = new ComponentBuilder( "" ); if ( !entry.getValue().isEmpty() ) { - builder.event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, - new ComponentBuilder( Joiner.on( ", " ).join( entry.getValue() ) ).color( ChatColor.YELLOW ).create() ) ); + String text; + synchronized ( entry.getValue() ) + { + text = Joiner.on( ", " ).join( entry.getValue() ); + } + builder.event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( text ).color( ChatColor.YELLOW ).create() ) ); } builder.append( entry.getKey().name() + ": " ).color( ChatColor.GREEN ); builder.append( "" + entry.getValue().size() ).bold( true );