2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
|
|
|
+++ b/net/minecraft/network/protocol/PlayerConnectionUtils.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -10,6 +10,11 @@
|
2022-02-28 16:00:00 +01:00
|
|
|
import net.minecraft.util.thread.IAsyncTaskHandler;
|
|
|
|
import org.slf4j.Logger;
|
2021-03-15 23:00:00 +01:00
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import net.minecraft.server.MinecraftServer;
|
2023-09-21 18:40:00 +02:00
|
|
|
+import net.minecraft.server.network.ServerCommonPacketListenerImpl;
|
2021-03-15 23:00:00 +01:00
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
|
|
|
public class PlayerConnectionUtils {
|
|
|
|
|
2022-02-28 16:00:00 +01:00
|
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -23,6 +28,7 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T t0, IAsyncTaskHandler<?> iasynctaskhandler) throws CancelledPacketHandleException {
|
|
|
|
if (!iasynctaskhandler.isSameThread()) {
|
2022-02-28 16:00:00 +01:00
|
|
|
iasynctaskhandler.executeIfPossible(() -> {
|
2024-03-09 23:20:54 +01:00
|
|
|
+ if (t0 instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
2023-09-21 18:40:00 +02:00
|
|
|
if (t0.shouldHandleMessage(packet)) {
|
2022-02-28 16:00:00 +01:00
|
|
|
try {
|
|
|
|
packet.handle(t0);
|