1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-30 19:28:14 +02:00

Fix cancelled HangingPlaceEvent inventory desync ()

This commit is contained in:
Warrior 2025-02-25 22:33:35 +01:00 committed by GitHub
parent fc56c728c0
commit f63dbeafde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/HangingEntityItem.java
+++ b/net/minecraft/world/item/HangingEntityItem.java
@@ -66,6 +_,19 @@
@@ -66,6 +_,20 @@
if (hangingEntity.survives()) {
if (!level.isClientSide) {
@ -14,6 +14,7 @@
+ level.getCraftServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ if (player != null) player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
+ return InteractionResult.FAIL;
+ }
+ // CraftBukkit end