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 fc364823f20f458af936c7209bd7174e05cb0fc0..9d04d3d1e24222bf255a1fc96761909574f67d66 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2279,7 +2279,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 e3f3ddbf6d5c20489f3cfda9126ef64954b7418d..1c31e887a23398c2717426209a8625bdd0e1a807 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