aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLulu13022002 <[email protected]>2024-11-18 20:47:52 +0100
committerGitHub <[email protected]>2024-11-18 20:47:52 +0100
commit6735c60738ae1723edafb37d705550fe4b11cc6a (patch)
tree5817e20aa85c5f31817d1733009178e8244a2bad
parentd8b66dd93d760fcbbc295bfd9b1abfdf8239f2f5 (diff)
downloadPaper-6735c60738ae1723edafb37d705550fe4b11cc6a.tar.gz
Paper-6735c60738ae1723edafb37d705550fe4b11cc6a.zip
Fix enderchest opening animation (#11635)
-rw-r--r--patches/server/1017-Fix-InventoryOpenEvent-cancellation.patch13
1 files changed, 7 insertions, 6 deletions
diff --git a/patches/server/1017-Fix-InventoryOpenEvent-cancellation.patch b/patches/server/1017-Fix-InventoryOpenEvent-cancellation.patch
index 2ac771df85..eb14b552dc 100644
--- a/patches/server/1017-Fix-InventoryOpenEvent-cancellation.patch
+++ b/patches/server/1017-Fix-InventoryOpenEvent-cancellation.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix InventoryOpenEvent cancellation
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index b6b8687fc79c060cd65e04dc67c855c775ab7684..e2527f3e2b96df539c765ae23c83a09d3298d430 100644
+index a13f88ed2ce39848b1fe1673265cf6c62adbfb66..08a82b7a3456f58b3d0fdbb8e8dbce6972ad1672 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1942,6 +1942,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -198,7 +198,7 @@ index 500c56c4ef0878434582a50d6dba2ccca9773275..5a6c153fa2873aecba0d0d02be2cc2a5
}
diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
-index ef0d469176ee74b6bb5f9e9cc508735145fda5b8..ebb9baca7a65173f7c9fdf9bf47a8db876719625 100644
+index ef0d469176ee74b6bb5f9e9cc508735145fda5b8..2a207fb2e1c26b562de42240e11c856bd2a23458 100644
--- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
@@ -86,11 +86,13 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
@@ -206,15 +206,16 @@ index ef0d469176ee74b6bb5f9e9cc508735145fda5b8..ebb9baca7a65173f7c9fdf9bf47a8db8
return InteractionResult.SUCCESS;
} else {
- if (world instanceof ServerLevel serverLevel) {
+- playerEnderChestContainer.setActiveChest(enderChestBlockEntity);
+- player.openMenu(
+- new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
+- );
+ // Paper start - Fix InventoryOpenEvent cancellation - moved up;
++ playerEnderChestContainer.setActiveChest(enderChestBlockEntity); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
+ if (world instanceof ServerLevel serverLevel && player.openMenu(
+ new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
+ ).isPresent()) {
+ // Paper end - Fix InventoryOpenEvent cancellation - moved up;
- playerEnderChestContainer.setActiveChest(enderChestBlockEntity);
-- player.openMenu(
-- new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
-- );
+ // Paper - Fix InventoryOpenEvent cancellation - moved up;
player.awardStat(Stats.OPEN_ENDERCHEST);
PiglinAi.angerNearbyPiglins(serverLevel, player, true);