13
0
geforkt von Mirrors/Paper

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
Dieser Commit ist enthalten in:
Mariell Hoversholm 2020-10-01 15:16:32 +02:00
Ursprung cc79d358e8
Commit ae82e7eb1c
3 geänderte Dateien mit 8 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -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());

Datei anzeigen

@ -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