Skip to content

Commit 255c25e

Browse files
authored
fix "do not prematurely disconnect players on stop" (#13625)
1 parent 6103cc7 commit 255c25e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

paper-server/patches/sources/net/minecraft/network/PacketProcessor.java.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/network/PacketProcessor.java
22
+++ b/net/minecraft/network/PacketProcessor.java
3-
@@ -19,6 +_,22 @@
3+
@@ -19,15 +_,42 @@
44
this.runningThread = runningThread;
55
}
66

@@ -23,9 +23,11 @@
2323
public boolean isSameThread() {
2424
return Thread.currentThread() == this.runningThread;
2525
}
26-
@@ -27,7 +_,18 @@
26+
27+
public <T extends PacketListener> void scheduleIfPossible(T listener, Packet<T> packet) {
2728
if (this.closed) {
28-
throw new RejectedExecutionException("Server already shutting down");
29+
- throw new RejectedExecutionException("Server already shutting down");
30+
+ throw new io.papermc.paper.util.ServerStopRejectedExecutionException("Server already shutting down"); // Paper - do not prematurely disconnect players on stop
2931
} else {
3032
- this.packetsToBeHandled.add(new PacketProcessor.ListenerAndPacket<>(listener, packet));
3133
+ // Paper start - improve tick loop

0 commit comments

Comments
 (0)