From add387dee37a601e25f8acd65e41a98a9eb782c6 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Wed, 15 Aug 2012 12:22:52 -0500 Subject: [PATCH] Call PlayerQuitEvent in correct location. Fixes BUKKIT-2193 --- .../ServerConfigurationManagerAbstract.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java index bbc50403e9..0939c93eb8 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java @@ -201,18 +201,19 @@ public abstract class ServerConfigurationManagerAbstract { public String disconnect(EntityPlayer entityplayer) { // CraftBukkit - return string if (entityplayer.netServerHandler.disconnected) return null; // CraftBukkit - exploitsies fix - // this.b(entityplayer); // CraftBukkit - Quitting must be before we do final save of data, in case plugins need to modify it + // CraftBukkit start - quitting must be before we do final save of data, in case plugins need to modify it + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.name + " left the game."); + this.cserver.getPluginManager().callEvent(playerQuitEvent); + // CraftBukkit end + + this.b(entityplayer); WorldServer worldserver = entityplayer.q(); worldserver.kill(entityplayer); worldserver.getPlayerManager().removePlayer(entityplayer); this.players.remove(entityplayer); - // CraftBukkit start - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.name + " left the game."); - this.cserver.getPluginManager().callEvent(playerQuitEvent); - - // .name -> .listName, replace sendAll with loop + // CraftBukkit start - .name -> .listName, replace sendAll with loop Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, false, 9999); for (int i = 0; i < this.players.size(); ++i) { EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i); @@ -222,8 +223,6 @@ public abstract class ServerConfigurationManagerAbstract { } } - this.b(entityplayer); - return playerQuitEvent.getQuitMessage(); // CraftBukkit end }