mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
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
This commit is contained in:
parent
cc79d358e8
commit
ae82e7eb1c
3 changed files with 8 additions and 12 deletions
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5da21f87d6b0953f73941e68f5a09dc473d7cd5e
|
||||
Subproject commit 5c77bd28168a4ee3b2f057a1c25849c5b1502c8e
|
Loading…
Reference in a new issue