Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Don't add player to world if join event did it already.
On join we unconditionally add the player to the world they logged out in. If a plugin teleports a player during PlayerJoinEvent in a way that adds them to a world (cross-world teleport) we end up with one player in two places. To avoid this we check to see if the player has changed worlds or is already added to the world we have we skip adding them again.
Dieser Commit ist enthalten in:
Ursprung
cc78e17312
Commit
8f4cde24bd
@ -160,8 +160,12 @@ public abstract class ServerConfigurationManagerAbstract {
|
|||||||
this.cserver.onPlayerJoin(playerJoinEvent.getPlayer());
|
this.cserver.onPlayerJoin(playerJoinEvent.getPlayer());
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
worldserver.addEntity(entityplayer);
|
// CraftBukkit start - only add if the player wasn't moved in the event
|
||||||
this.a(entityplayer, (WorldServer) null);
|
if (entityplayer.world == worldserver && !worldserver.players.contains(entityplayer)) {
|
||||||
|
worldserver.addEntity(entityplayer);
|
||||||
|
this.a(entityplayer, (WorldServer) null);
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
// CraftBukkit start - sendAll above replaced with this loop
|
// CraftBukkit start - sendAll above replaced with this loop
|
||||||
Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, true, 1000);
|
Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, true, 1000);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren