Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-14 20:10:05 +01:00
Allow old views to continue updating its content to player pre interaction
Dieser Commit ist enthalten in:
Ursprung
86cfb0435e
Commit
6aafb11f5a
@ -7,7 +7,7 @@ Subject: [PATCH] Fix and enhance openInventory(InventoryView)
|
|||||||
public net.minecraft.world.inventory.HorseInventoryMenu horse
|
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
|
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
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||||
+++ b/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 {
|
@@ -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");
|
Preconditions.checkArgument(this.equals(inventory.getPlayer()), "InventoryView must belong to the opening player");
|
||||||
if (!(this.getHandle() instanceof ServerPlayer)) return; // TODO: NPC support?
|
if (!(this.getHandle() instanceof ServerPlayer)) return; // TODO: NPC support?
|
||||||
if (((ServerPlayer) this.getHandle()).connection == null) return;
|
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
|
// 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)));
|
+ 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)
|
+ // Paper end - fix and enhance openInventory(InventoryView)
|
||||||
player.containerMenu = container;
|
player.containerMenu = container;
|
||||||
player.initMenu(container);
|
player.initMenu(container);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren