geforkt von Mirrors/Paper
Improve diff in ServerPlayer#openHorseInventory
Dieser Commit ist enthalten in:
Ursprung
993db46961
Commit
68bbd2e202
@ -966,12 +966,8 @@
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openHorseInventory(AbstractHorse horse, Container inventory) {
|
public void openHorseInventory(AbstractHorse horse, Container inventory) {
|
||||||
- if (this.containerMenu != this.inventoryMenu) {
|
|
||||||
- this.closeContainer();
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
+ // CraftBukkit start - Inventory open hook
|
+ // 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());
|
+ AbstractContainerMenu container = new HorseInventoryMenu(this.containerCounter, this.getInventory(), inventory, horse, horse.getInventoryColumns());
|
||||||
+ container.setTitle(horse.getDisplayName());
|
+ container.setTitle(horse.getDisplayName());
|
||||||
+ container = org.bukkit.craftbukkit.event.CraftEventFactory.callInventoryOpenEvent(this, container);
|
+ container = org.bukkit.craftbukkit.event.CraftEventFactory.callInventoryOpenEvent(this, container);
|
||||||
@ -981,10 +977,12 @@
|
|||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // 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.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.OPEN_NEW); // Paper - Inventory close reason
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
|
- this.nextContainerCounter();
|
||||||
+ // this.nextContainerCounter(); // CraftBukkit - moved up
|
+ // this.nextContainerCounter(); // CraftBukkit - moved up
|
||||||
int inventoryColumns = horse.getInventoryColumns();
|
int inventoryColumns = horse.getInventoryColumns();
|
||||||
this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, inventoryColumns, horse.getId()));
|
this.connection.send(new ClientboundHorseScreenOpenPacket(this.containerCounter, inventoryColumns, horse.getId()));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren