From 6aafb11f5a8c6fb8c601f3acaa8911baaa7137b2 Mon Sep 17 00:00:00 2001 From: masmc05 Date: Sun, 13 Oct 2024 01:00:34 +0300 Subject: [PATCH] Allow old views to continue updating its content to player pre interaction --- .../1063-Fix-and-enhance-openInventory-InventoryView.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patches/server/1063-Fix-and-enhance-openInventory-InventoryView.patch b/patches/server/1063-Fix-and-enhance-openInventory-InventoryView.patch index ad75110cd3..00fca378fd 100644 --- a/patches/server/1063-Fix-and-enhance-openInventory-InventoryView.patch +++ b/patches/server/1063-Fix-and-enhance-openInventory-InventoryView.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Fix and enhance openInventory(InventoryView) public net.minecraft.world.inventory.HorseInventoryMenu horse diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 7dcfb45c24d7743956be514c7d554e06aac77b3e..c3ee999a4ec2f2256f53322be70b7878af870bb1 100644 +index 7dcfb45c24d7743956be514c7d554e06aac77b3e..883130e8280c1c518cfb00198eba3c726a409003 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -436,6 +436,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -29,7 +29,7 @@ index 7dcfb45c24d7743956be514c7d554e06aac77b3e..c3ee999a4ec2f2256f53322be70b7878 Preconditions.checkArgument(this.equals(inventory.getPlayer()), "InventoryView must belong to the opening player"); if (!(this.getHandle() instanceof ServerPlayer)) return; // TODO: NPC support? if (((ServerPlayer) this.getHandle()).connection == null) return; -@@ -461,14 +473,23 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -461,14 +473,24 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // Now open the window @@ -52,6 +52,7 @@ index 7dcfb45c24d7743956be514c7d554e06aac77b3e..c3ee999a4ec2f2256f53322be70b7878 + player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); + } + } ++ container.resumeRemoteUpdates(); + // Paper end - fix and enhance openInventory(InventoryView) player.containerMenu = container; player.initMenu(container);