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
2022-03-01 05:43:03 +00:00
index fa3344c71a9715ad465f39be92cb724368ae2b03..2fbe90ba893393e04b72b9feeff5f6be09d65e16 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-03-01 05:43:03 +00:00
@@ -2156,7 +2156,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 47d8ae1eb7edea51a81ddfaef3cd1c4b06ad12a3..6995539a536f0019839a177ffb6e633c8013a8fb 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-03-01 05:43:03 +00:00
@@ -2845,7 +2845,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