mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix enderchest opening animation (#11635)
This commit is contained in:
parent
9dcfb32d11
commit
33bafcbf2d
1 changed files with 5 additions and 4 deletions
|
@ -206,15 +206,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
- if (world instanceof ServerLevel serverLevel) {
|
- 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;
|
+ // 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(
|
+ if (world instanceof ServerLevel serverLevel && player.openMenu(
|
||||||
+ new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
|
+ new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE)
|
||||||
+ ).isPresent()) {
|
+ ).isPresent()) {
|
||||||
+ // Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
+ // 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;
|
+ // Paper - Fix InventoryOpenEvent cancellation - moved up;
|
||||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||||
PiglinAi.angerNearbyPiglins(serverLevel, player, true);
|
PiglinAi.angerNearbyPiglins(serverLevel, player, true);
|
||||||
|
|
Loading…
Reference in a new issue