aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-12-19 21:48:24 +0100
committerBjarne Koll <[email protected]>2024-12-20 03:07:58 +0100
commit68bbd2e202431b0f6ad968bd309e6522e87b8c2f (patch)
tree2e281531194dac27f3e2eb1a3c38285782f65867
parent993db46961dfe7e1a3617795f0df8205ff0b76e7 (diff)
downloadPaper-68bbd2e202431b0f6ad968bd309e6522e87b8c2f.tar.gz
Paper-68bbd2e202431b0f6ad968bd309e6522e87b8c2f.zip
Improve diff in ServerPlayer#openHorseInventory
-rw-r--r--paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch14
1 files changed, 6 insertions, 8 deletions
diff --git a/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch
index eae0ca32da..ce890ce4a0 100644
--- a/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch
+++ b/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch
@@ -966,12 +966,8 @@
@Override
public void openHorseInventory(AbstractHorse horse, Container inventory) {
-- if (this.containerMenu != this.inventoryMenu) {
-- this.closeContainer();
-- }
--
+ // CraftBukkit start - Inventory open hook
- this.nextContainerCounter();
++ this.nextContainerCounter(); // Moved up from below
+ AbstractContainerMenu container = new HorseInventoryMenu(this.containerCounter, this.getInventory(), inventory, horse, horse.getInventoryColumns());
+ container.setTitle(horse.getDisplayName());
+ container = org.bukkit.craftbukkit.event.CraftEventFactory.callInventoryOpenEvent(this, container);
@@ -981,10 +977,12 @@
+ return;
+ }
+ // CraftBukkit end
-+ if (this.containerMenu != this.inventoryMenu) {
+ if (this.containerMenu != this.inventoryMenu) {
+- this.closeContainer();
+ this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.OPEN_NEW); // Paper - Inventory close reason
-+ }
-+
+ }
+
+- this.nextContainerCounter();
+ // this.nextContainerCounter(); // CraftBukkit - moved up
int inventoryColumns = horse.getInventoryColumns();
this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, inventoryColumns, horse.getId()));