PaperMC/patches/server/0123-Properly-fix-item-duplication-bug.patch
2021-07-07 06:52:40 +00:00

33 lines
1.7 KiB
Diff

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 d5bdf1e58bf48b5738e98159afb54630220af5b0..823fc38b5bbf5eac2d2e7cc48c4b0557d252f960 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2123,7 +2123,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 9026dd91f8d874209bbfd4cdfd3c41e37cdd7560..6eb01dcf59fda2656b6d93b0c39380302665f930 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2810,7 +2810,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