Issue: Shutdown logic is concurrently reading and writing to LightManager#tasks.
Fix: Add synchronization check and separate read/write/clear operations.
[03:57:01] [Server thread/ERROR]: Error occurred (in the plugin loader) while disabling DynamicLights v1.0.2-SNAPSHOT (Is it up to date?)
java.util.ConcurrentModificationException: null
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?]
at java.util.HashMap$KeyIterator.next(HashMap.java:1620) ~[?:?]
at com.github.xcykrix.dynamiclights.util.LightManager.shutdown(LightManager.java:44) ~[DynamicLights-1.0.2-SNAPSHOT.jar:?]
at com.github.xcykrix.dynamiclights.DynamicLights.shutdown(DynamicLights.java:35) ~[DynamicLights-1.0.2-SNAPSHOT.jar:?]
at com.github.xcykrix.plugincommon.PluginCommon.onDisable(PluginCommon.java:56) ~[DynamicLights-1.0.2-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:283) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:224) ~[paper-1.20.1.jar:git-Paper-43]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:148) ~[paper-1.20.1.jar:git-Paper-43]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:92) ~[paper-1.20.1.jar:git-Paper-43]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:528) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.disablePlugins(CraftServer.java:567) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:943) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:806) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1210) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-43]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Issue: Shutdown logic is concurrently reading and writing to LightManager#tasks. Fix: Add synchronization check and separate read/write/clear operations.