Skip to content

Commit

Permalink
synchronize while iterating syncronizedList in CommandSend
Browse files Browse the repository at this point in the history
  • Loading branch information
Outfluencer authored Oct 9, 2023
1 parent a7dbbc2 commit e66b81b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit e66b81b

Please sign in to comment.