Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 21:10:10 +01:00
Call PlayerQuitEvent in correct location. Fixes BUKKIT-2193
Dieser Commit ist enthalten in:
Ursprung
fc35d000e4
Commit
add387dee3
@ -201,18 +201,19 @@ public abstract class ServerConfigurationManagerAbstract {
|
|||||||
public String disconnect(EntityPlayer entityplayer) { // CraftBukkit - return string
|
public String disconnect(EntityPlayer entityplayer) { // CraftBukkit - return string
|
||||||
if (entityplayer.netServerHandler.disconnected) return null; // CraftBukkit - exploitsies fix
|
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 worldserver = entityplayer.q();
|
||||||
|
|
||||||
worldserver.kill(entityplayer);
|
worldserver.kill(entityplayer);
|
||||||
worldserver.getPlayerManager().removePlayer(entityplayer);
|
worldserver.getPlayerManager().removePlayer(entityplayer);
|
||||||
this.players.remove(entityplayer);
|
this.players.remove(entityplayer);
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start - .name -> .listName, replace sendAll with loop
|
||||||
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
|
|
||||||
Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, false, 9999);
|
Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, false, 9999);
|
||||||
for (int i = 0; i < this.players.size(); ++i) {
|
for (int i = 0; i < this.players.size(); ++i) {
|
||||||
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
|
||||||
@ -222,8 +223,6 @@ public abstract class ServerConfigurationManagerAbstract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.b(entityplayer);
|
|
||||||
|
|
||||||
return playerQuitEvent.getQuitMessage();
|
return playerQuitEvent.getQuitMessage();
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren