Skip to content

Post Friendship update to main thread#109

Merged
applenick merged 1 commit into
devfrom
main-thread
Jun 13, 2026
Merged

Post Friendship update to main thread#109
applenick merged 1 commit into
devfrom
main-thread

Conversation

@cswhite2000

Copy link
Copy Markdown
Member

Should fix the following bug:

 java.util.ConcurrentModificationException
 	at java.base/java.util.ArrayList.sortRange(ArrayList.java:1819)
 	at java.base/java.util.ArrayList.sort(ArrayList.java:1810)
 	at tc.oc.pgm.tablist.MatchTabView.renderTeam(MatchTabView.java:80)
 	at tc.oc.pgm.tablist.MatchTabView.render(MatchTabView.java:204)
 	at tc.oc.pgm.util.tablist.TabManager.priorityRender(TabManager.java:126)
 	at tc.oc.pgm.tablist.MatchTabManager$RenderTask.run(MatchTabManager.java:407)
 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
 	at tc.oc.pgm.util.concurrent.TaskExecutorService$Task.run(TaskExecutorService.java:233)
 	at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:64)
 	at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:409)
 	at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:926)
 	at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:392)
 	at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:848)
 	at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:742)
 	at java.base/java.lang.Thread.run(Thread.java:1474)

General explanation is that FriendshipFeatureCore listens for an async pre login event. Then Community dispatches a NameDecorationChangeEvent while still off of the main thread. PGM listens for that event in a number of locations that assume this event is only invoked on the main thread. So fix is to post the event launch to the main thread.

Signed-off-by: Christopher White <18whitechristop@gmail.com>
@cswhite2000
cswhite2000 requested a review from applenick June 13, 2026 03:15

@applenick applenick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! 👍

@applenick
applenick merged commit d308674 into dev Jun 13, 2026
2 checks passed
@applenick
applenick deleted the main-thread branch July 19, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants