From d1e6408ea2a06e88cdfbadc585291812d179c52d Mon Sep 17 00:00:00 2001 From: afforess Date: Sun, 3 Apr 2011 13:02:35 -0400 Subject: [PATCH] Changed PlayerQuit to allow last minute modifications to player state. --- .../server/ServerConfigurationManager.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index b2a4e9a19d..71a56c3f47 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -112,16 +112,18 @@ public class ServerConfigurationManager { } public String c(EntityPlayer entityplayer) { // CraftBukkit - changed return type + // CraftBukkit start + // Quitting must be before we do final save of data, in case plugins need to modify it + ((WorldServer) entityplayer.world).manager.b(entityplayer); + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(server.getPlayer(entityplayer), "\u00A7e" + entityplayer.name + " left the game."); + server.getPluginManager().callEvent(playerQuitEvent); + // CraftBukkit end + this.n.a(entityplayer); entityplayer.world.d(entityplayer); // CraftBukkit this.b.remove(entityplayer); - // CraftBukkit start - ((WorldServer) entityplayer.world).manager.b(entityplayer); - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(server.getPlayer(entityplayer), "\u00A7e" + entityplayer.name + " left the game."); - server.getPluginManager().callEvent(playerQuitEvent); - return playerQuitEvent.getQuitMessage(); - // CraftBukkit end + return playerQuitEvent.getQuitMessage(); // CraftBukkit } public EntityPlayer a(NetLoginHandler netloginhandler, String s, String s1) {