mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 13:42:25 -07:00
Fix cancelled HangingPlaceEvent inventory desync (#12161)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/item/HangingEntityItem.java
|
--- a/net/minecraft/world/item/HangingEntityItem.java
|
||||||
+++ b/net/minecraft/world/item/HangingEntityItem.java
|
+++ b/net/minecraft/world/item/HangingEntityItem.java
|
||||||
@@ -66,6 +_,19 @@
|
@@ -66,6 +_,20 @@
|
||||||
|
|
||||||
if (hangingEntity.survives()) {
|
if (hangingEntity.survives()) {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
+ level.getCraftServer().getPluginManager().callEvent(event);
|
+ level.getCraftServer().getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
|
+ if (player != null) player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
|
||||||
+ return InteractionResult.FAIL;
|
+ return InteractionResult.FAIL;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
Reference in New Issue
Block a user