bergerhealer / TrainCarts

Minecarts redefined
MIT License
205 stars 63 forks source link

Command error at shutdown #451

Closed stijnb1234 closed 2 years ago

stijnb1234 commented 2 years ago

Info

Please provide the following information:


Bug

Description

When I shutdown the server, I get an error.

Expected behaviour

There should be no error.

Actual behaviour

It gives an error.

Steps to reproduce

  1. Setup a new PaperSpigot 1.19.2 server.
  2. Put the latest builds of BKCommonLib and TrainCarts in the server.
  3. Start the server, do some things, and stop it again.
  4. You see the error.

Additional Information

The error I get:

[10:15:10 INFO]: [Train_Carts] Disabling Train_Carts v1.19.2-v1-SNAPSHOT
[10:15:10 ERROR]: Could not pass event PluginDisableEvent to Train_Carts v1.19.2-v1-SNAPSHOT
java.util.concurrent.RejectedExecutionException: Task net.minecraft.commands.CommandDispatcher$$Lambda$8229/0x00000008024b2698@33b6683 rejected from java.util.concurrent.ThreadPoolExecutor@3bd7073e[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2065) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:833) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1365) ~[?:?]
        at net.minecraft.commands.Commands.sendCommands(Commands.java:376) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.updateCommands(CraftPlayer.java:2550) ~[paper-1.19.2.jar:git-Paper-119]
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
        at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092) ~[?:?]
        at com.bergerkiller.bukkit.common.dep.cloud.bukkit.BukkitPluginRegistrationHandler.unregisterRootCommand(BukkitPluginRegistrationHandler.java:170) ~[BKCommonLib-1.19.2-v1-1352.jar:?]
        at com.bergerkiller.bukkit.common.dep.cloud.CommandManager.deleteRootCommand(CommandManager.java:545) ~[BKCommonLib-1.19.2-v1-1352.jar:?]
        at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
        at com.bergerkiller.bukkit.common.dep.cloud.bukkit.CloudBukkitListener.onPluginDisable(CloudBukkitListener.java:54) ~[BKCommonLib-1.19.2-v1-1352.jar:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:37) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-119]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:393) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:579) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:556) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.disablePlugins(CraftServer.java:499) ~[paper-1.19.2.jar:git-Paper-119]
        at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:933) ~[paper-1.19.2.jar:git-Paper-119]
        at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:781) ~[paper-1.19.2.jar:git-Paper-119]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1231) ~[paper-1.19.2.jar:git-Paper-119]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-119]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[10:15:10 INFO]: [Train_Carts] Train_Carts disabled!
bergerkiller commented 2 years ago

Oh that looks like a Cloud bug, Ill forward it to them

bergerkiller commented 2 years ago

It probably has no effect as only the plugin disable event handler gets hit, so the plugin still disables normally. This would be a problem for /reload though

stijnb1234 commented 2 years ago

It probably has no effect as only the plugin disable event handler gets hit, so the plugin still disables normally. This would be a problem for /reload though

It indeed does not affect functionality, but still something the Cloud developers should look into. 😛

bergerkiller commented 2 years ago

https://github.com/PaperMC/Paper/pull/8272 might be related

Owen1212055 commented 2 years ago

Correct, that is related and will be resolved by that PR.