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