mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 06:50:12 +01:00
Don't handle sync packets for kicked players
This commit is contained in:
parent
d5e96882ad
commit
2ced02339a
2 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
|
|
10
nms-patches/PlayerConnectionUtils.patch
Normal file
10
nms-patches/PlayerConnectionUtils.patch
Normal 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;
|
Loading…
Reference in a new issue