From ae82e7eb1c73ba0eb14ae7cd5fc9de6c53413cdf Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Thu, 1 Oct 2020 15:16:32 +0200 Subject: [PATCH] Updated Upstream (CraftBukkit) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 5c77bd28 SPIGOT-6147: InventoryCloseEvent does not fire after closing player inventory --- .../InventoryCloseEvent-Reason-API.patch | 16 ++++++---------- .../Load-Chunks-for-Login-Asynchronously.patch | 2 +- work/CraftBukkit | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 792281aec8..f01fa2edb3 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -121,14 +121,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { - entityplayer.a(StatisticList.LEAVE_GAME); - // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it -- entityplayer.closeInventory(); -+ entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper + // See SPIGOT-5799, SPIGOT-6145 + if (entityplayer.activeContainer != entityplayer.defaultContainer) { +- entityplayer.closeInventory(); ++ entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper + } PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); - cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java @@ -216,15 +216,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + @Deprecated public static void handleInventoryCloseEvent(EntityHuman human) { +- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView()); + handleInventoryCloseEvent(human, org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNKNOWN); + } + public static void handleInventoryCloseEvent(EntityHuman human, org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) { + // Paper end - // SPIGOT-5799 - no need to fire for when no inventory open - if (human.activeContainer == human.defaultContainer) { - return; - } -- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView()); + InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView(), reason); // Paper human.world.getServer().getPluginManager().callEvent(event); human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity()); diff --git a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch index 647c6a14cd..869544eec8 100644 --- a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch +++ b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch @@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit @@ -0,0 +0,0 @@ public abstract class PlayerList { - entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper + } PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); - cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/work/CraftBukkit b/work/CraftBukkit index 5da21f87d6..5c77bd2816 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 5da21f87d6b0953f73941e68f5a09dc473d7cd5e +Subproject commit 5c77bd28168a4ee3b2f057a1c25849c5b1502c8e