testserver/patches/server/0119-Properly-fix-item-dupl...

34 lines
1.7 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
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 73fe1f1047e39eeeb8a1444fa353f7d1a8e651b3..4b65dc12dc97e72b221d9fd15202a1a0622ef806 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2022-06-07 20:12:48 +00:00
@@ -2199,7 +2199,7 @@ public class ServerPlayer extends Player {
2021-06-11 12:02:28 +00:00
@Override
public boolean isImmobile() {
- return super.isImmobile() || !this.getBukkitEntity().isOnline();
2021-06-11 12:02:28 +00:00
+ 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 bfcbfc08fb329ebded5376c4a78d13e659323a64..3f1bda6c17fca41150bfaab2cd5a4e8849bd439d 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2022-06-07 20:12:48 +00:00
@@ -3036,7 +3036,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
2021-06-11 12:02:28 +00:00
}
public final boolean isDisconnected() {
- return !this.player.joining && !this.connection.isConnected();
+ return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
}
// CraftBukkit end