From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Tue, 27 Dec 2016 01:57:57 +0000 Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index b3d285b920a2ec83c320b842183ae8e2d491c455..66705a8fb0ba4ca27136ee75420a08bc99ebd965 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2268,7 +2268,7 @@ public class ServerPlayer extends Player { @Override public boolean isImmobile() { - return super.isImmobile() || !this.getBukkitEntity().isOnline(); + return super.isImmobile() || (this.connection != null && this.connection.isDisconnected()); // Paper } @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 4ccb315828005258f5bd4c4a651d572e439c4909..487031aec842719a72abf0037409520ca98ce3f7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3178,7 +3178,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } public final boolean isDisconnected() { - return !this.player.joining && !this.connection.isConnected(); + return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } // CraftBukkit end