Fix premature player kicks on shutdown

When the server is stopping, the default execution handler method will throw a
RejectedExecutionException in order to prevent further execution, this causes
us to lose the actual kick reason. To mitigate this, we'll use a seperate marked
class in order to gracefully ignore these.
This commit is contained in:
Shane Freeder
2024-04-11 16:37:44 +01:00
parent bc5dd992ab
commit 26fe3d0cff
3 changed files with 57 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
package io.papermc.paper.util;
import java.util.concurrent.RejectedExecutionException;
public class ServerStopRejectedExecutionException extends RejectedExecutionException {
public ServerStopRejectedExecutionException() {
}
public ServerStopRejectedExecutionException(final String message) {
super(message);
}
public ServerStopRejectedExecutionException(final String message, final Throwable cause) {
super(message, cause);
}
public ServerStopRejectedExecutionException(final Throwable cause) {
super(cause);
}
}