aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0123-Properly-fix-item-duplication-bug.patch
blob: 2bc365640f25ce934c31c727eb89353c41cef7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
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 da722cddaaa8c40715748de81104a5b213c2fea8..a61798909aee1b73b62c88c22fa6cfc1fe2a5942 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2128,7 +2128,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 9c7843c2623fce4ec423acbcc0c76a35b1bd5969..36bb3b502a26ab43f442d85b3cad4a1de0a5bda8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2812,7 +2812,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
     }
 
     public final boolean isDisconnected() {
-        return !this.player.joining && !this.connection.isConnected();
+        return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
     }
     // CraftBukkit end