aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0130-Properly-fix-item-duplication-bug.patch
blob: 67b2c6d89d1d54c28872d90b4f6fb8d997dd8c7b (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
34
35
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/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 4b9595f89c75b220fe70840a74e0aaa0276fa122..09385eabefeb7d59de1ce4138648badd123396f9 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -2060,8 +2060,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
     }
 
     @Override
-    public boolean isFrozen() {
-        return super.isFrozen() || !getBukkitEntity().isOnline();
+    protected boolean isFrozen() {
+        return super.isFrozen() || (this.playerConnection != null && this.playerConnection.isDisconnected()); // Paper
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 908d52f48b4bf2ddd638f2d718e1f6cb6148ce0a..8a5a1ca08073d1a4df949a53fbf7e75339bf2761 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -2819,7 +2819,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
     }
 
     public final boolean isDisconnected() {
-        return !this.player.joining && !this.networkManager.isConnected();
+        return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper
     }
     // CraftBukkit end