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 d90748aab21adf9c7f463e31e7d7eb5f9bc0bbbd..40efa19ffe9275748a62e0546c3fd42bbcb0883d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2352,7 +2352,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/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index e8b12a8ae009023afa2818ecbf398a1440b9926e..6faec2ca225fcebbad65190ab485e2cab77cfd6e 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -145,7 +145,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } public final boolean isDisconnected() { - return !this.player.joining && !this.connection.isConnected(); + return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } // CraftBukkit end