aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0120-Properly-fix-item-duplication-bug.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0120-Properly-fix-item-duplication-bug.patch')
-rw-r--r--patches/server/0120-Properly-fix-item-duplication-bug.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0120-Properly-fix-item-duplication-bug.patch b/patches/server/0120-Properly-fix-item-duplication-bug.patch
new file mode 100644
index 0000000000..7a9b41d7f1
--- /dev/null
+++ b/patches/server/0120-Properly-fix-item-duplication-bug.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Alfie Cleveland <[email protected]>
+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 e9fe09f77aacc0b7b13e95d4d04d94fdfa2181c3..269cfe7aa87cf4a73ee2faca142c83e4d10a98c7 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -2627,7 +2627,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+
+ @Override
+ public boolean isImmobile() {
+- return super.isImmobile() || !this.getBukkitEntity().isOnline();
++ return super.isImmobile() || (this.connection != null && this.connection.isDisconnected()); // Paper - Fix duplication bugs
+ }
+
+ @Override
+diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+index 8520f0f2b4b4e758b2e2fae206b7fd818a6fa14f..73d40f768b6882062656cba30acc5f86f26d1a96 100644
+--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+@@ -179,7 +179,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 - Fix duplication bugs
+ }
+ // CraftBukkit end
+