Don't handle sync packets for kicked players

This commit is contained in:
md_5 2019-02-03 14:23:04 +11:00
parent d5e96882ad
commit 2ced02339a
2 changed files with 11 additions and 1 deletions

View File

@ -73,7 +73,7 @@
+ }
+
+ private final org.bukkit.craftbukkit.CraftServer server;
+ private boolean processedDisconnect;
+ public boolean processedDisconnect;
+ private int lastTick = MinecraftServer.currentTick;
+ private int allowedPlayerTicks = 1;
+ private int lastDropTick = MinecraftServer.currentTick;

View File

@ -0,0 +1,10 @@
--- a/net/minecraft/server/PlayerConnectionUtils.java
+++ b/net/minecraft/server/PlayerConnectionUtils.java
@@ -5,6 +5,7 @@
public static <T extends PacketListener> void ensureMainThread(Packet<T> packet, T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isMainThread()) {
iasynctaskhandler.postToMainThread(() -> {
+ if (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect) return; // CraftBukkit
packet.a(t0);
});
throw CancelledPacketHandleException.INSTANCE;