APickledWalrus / skript-placeholders

Placeholder integration for Skript.
GNU General Public License v3.0
28 stars 8 forks source link

Placeholder doesnt register in 1.20.6 #58

Closed RyuguDev closed 1 month ago

RyuguDev commented 2 months ago

Description

When attempting to reload the Clan.sk script on my Minecraft server, a ConcurrentModificationException is thrown. This seems to be related to the command registration process.

Steps to Reproduce

  1. Start the server.
  2. Run the command to reload the Clan.sk script.
  3. Observe the console for the error.

Expected Behavior

The Clan.sk script should reload without any errors.

Errors / Screenshots

[13:12:18 INFO]: [Skript] Reloading Clan.sk...
[13:12:19 ERROR]: Caught previously unhandled exception :
[13:12:19 ERROR]: Paper Async Command Builder Thread Pool - 183
java.util.ConcurrentModificationException: null
        at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1023) ~[?:?]
        at java.base/java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:1052) ~[?:?]
        at net.minecraft.commands.Commands.fillUsableCommands(Commands.java:552) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.commands.Commands.sendAsync(Commands.java:515) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.commands.Commands.lambda$sendCommands$5(Commands.java:488) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
[13:12:19 INFO]: [PlaceholderAPI] Successfully registered internal expansion: clan [1.6.0]
[13:12:19 INFO]: [Skript] Successfully reloaded Clan.sk. (585ms)

Server Information

Additional Context

This issue appears to be related to the asynchronous command registration process. The error suggests that the commands map is being modified by multiple threads concurrently, which is not thread-safe. I suspect this may be an issue with how commands are registered or modified in the Clan.sk script or a related plugin.

The solution might involve ensuring proper synchronization of the commands map or reviewing the asynchronous logic used in the command registration process.

APickledWalrus commented 2 months ago

This is a Skript issue that should be fixed in the next release (of Skript).

APickledWalrus commented 1 month ago

Should be fixed in 2.8.7 https://github.com/SkriptLang/Skript/releases/tag/2.8.7