diff options
Diffstat (limited to 'patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch')
-rw-r--r-- | patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch index 312e25e58e..d3af97d48d 100644 --- a/patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0574-Fix-kick-event-leave-message-not-being-sent.patch @@ -96,7 +96,7 @@ index 5544ba7a5f61f24d081373f56f82e4ef0ef1f3f0..2722d22a9204554c1b52aa853b50f1ce this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 709cf6655e5ccb17caf0b8a735ae957cb0509f2c..2b7ad2b9cd525814c9f91d22606c42aa82ce9f94 100644 +index 709cf6655e5ccb17caf0b8a735ae957cb0509f2c..c1e172a39af88b98383f00eb88d82eb26efcac84 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -567,6 +567,11 @@ public abstract class PlayerList { @@ -111,3 +111,12 @@ index 709cf6655e5ccb17caf0b8a735ae957cb0509f2c..2b7ad2b9cd525814c9f91d22606c42aa ServerLevel worldserver = entityplayer.serverLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); +@@ -577,7 +582,7 @@ public abstract class PlayerList { + entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason + } + +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & Add API for quit reason ++ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), leaveMessage, entityplayer.quitReason); // Paper - Adventure & Add API for quit reason + this.cserver.getPluginManager().callEvent(playerQuitEvent); + entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); + |