aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2022-07-03 14:55:56 -0700
committerSpottedleaf <[email protected]>2022-07-03 14:55:56 -0700
commit41647af74caed955c1fd5b38d458ee59298ae5d4 (patch)
tree33e684c98755f11816b3cfee1e54f7c3433a2a6e /patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch
parented79fc947a2ab46dd2d57a1c6948de27b20dbb24 (diff)
downloadPaper-41647af74caed955c1fd5b38d458ee59298ae5d4.tar.gz
Paper-41647af74caed955c1fd5b38d458ee59298ae5d4.zip
Do not use worldgen executor for api profile completions
We cannot put blocking network I/O onto the worldgen threads, this will crash the server if it stalls
Diffstat (limited to 'patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch')
-rw-r--r--patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch
new file mode 100644
index 0000000000..948edcfd77
--- /dev/null
+++ b/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch
@@ -0,0 +1,18 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: chickeneer <[email protected]>
+Date: Thu, 22 Apr 2021 19:02:07 -0700
+Subject: [PATCH] fix PlayerItemHeldEvent firing twice
+
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index 6fb7bfd504839cc4a6f38ec9f99a571a1396e222..33354c6ca4005d3ae1aedc4fac57dcd047bab853 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1986,6 +1986,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
+ if (this.player.isImmobile()) return; // CraftBukkit
+ if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {
++ if (packet.getSlot() == this.player.getInventory().selected) { return; } // Paper - don't fire itemheldevent when there wasn't a slot change
+ PlayerItemHeldEvent event = new PlayerItemHeldEvent(this.getCraftPlayer(), this.player.getInventory().selected, packet.getSlot());
+ this.cserver.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {