diff options
author | Spottedleaf <[email protected]> | 2022-07-03 14:55:56 -0700 |
---|---|---|
committer | Spottedleaf <[email protected]> | 2022-07-03 14:55:56 -0700 |
commit | 41647af74caed955c1fd5b38d458ee59298ae5d4 (patch) | |
tree | 33e684c98755f11816b3cfee1e54f7c3433a2a6e /patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch | |
parent | ed79fc947a2ab46dd2d57a1c6948de27b20dbb24 (diff) | |
download | Paper-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.patch | 18 |
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()) { |