Skip to content

fix: avoid concurrent command tree rebuilds - #278

Merged
YsGqHY merged 1 commit into
CoderKuo:stable/v3from
Mirai-MC:stable/v3
Sep 30, 2026
Merged

YsGqHY merged 1 commit into
CoderKuo:stable/v3from
Mirai-MC:stable/v3

Conversation

@Missdrop

Copy link
Copy Markdown

Problem

[16:08:03] [Paper Async Command Builder Thread Pool - 3/ERROR]: Caught previously unhandled exception in Paper Async Command Builder Thread Pool - 3
java.util.ConcurrentModificationException
	at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1024) ~[?:?]
	at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1059) ~[?:?]
	at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1056) ~[?:?]
	at java.base/java.util.AbstractMap.hashCode(AbstractMap.java:499) ~[?:?]
	at com.mojang.brigadier.tree.CommandNode.hashCode(CommandNode.java:145) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at java.base/java.util.HashMap.hash(HashMap.java:338) ~[?:?]
	at java.base/java.util.HashMap.put(HashMap.java:619) ~[?:?]
	at net.minecraft.commands.Commands.sendAsync(Commands.java:521) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at net.minecraft.commands.Commands.lambda$sendCommands$0(Commands.java:503) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]
[16:08:03] [Paper Async Command Builder Thread Pool - 2/ERROR]: Caught previously unhandled exception in Paper Async Command Builder Thread Pool - 2
java.util.ConcurrentModificationException
	at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1024) ~[?:?]
	at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1059) ~[?:?]
	at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1056) ~[?:?]
	at java.base/java.util.AbstractMap.hashCode(AbstractMap.java:499) ~[?:?]
	at com.mojang.brigadier.tree.CommandNode.hashCode(CommandNode.java:145) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at java.base/java.util.HashMap.hash(HashMap.java:338) ~[?:?]
	at java.base/java.util.HashMap.put(HashMap.java:619) ~[?:?]
	at net.minecraft.commands.Commands.sendAsync(Commands.java:521) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at net.minecraft.commands.Commands.lambda$sendCommands$0(Commands.java:503) ~[purpur-26.3.jar:26.3-2642-0b28be2]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]

Summary

  • Skip dynamic command re-registration when the configuration has not changed.
  • Remove per-player updateCommands() calls that conflict with Paper's async command builder.
  • Fix ConcurrentModificationException when running /trmenu reload.

@YsGqHY
YsGqHY merged commit dd4acb5 into CoderKuo:stable/v3 Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants