PaperMC/nms-patches/PlayerConnectionUtils.patch

11 lines
681 B
Diff
Raw Normal View History

--- a/net/minecraft/server/PlayerConnectionUtils.java
+++ b/net/minecraft/server/PlayerConnectionUtils.java
2019-04-23 04:00:00 +02:00
@@ -9,6 +9,7 @@
public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isMainThread()) {
2019-04-23 04:00:00 +02:00
iasynctaskhandler.execute(() -> {
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
packet.a(t0);
});
throw CancelledPacketHandleException.INSTANCE;