Fix teleport failing right after join. Fixes BUKKIT-5479

Teleporting a player checks to see if the player is disconnected to
try to avoid creating ghost players. The check it uses, however, randomly
fails when the player is in the middle of joining the server. The check
that would work correctly here does not work correctly when the player
actually disconnects. To work around this we add a new flag which is
cleared on the first tick of the new player and assume they are connected
if the flag is set.
This commit is contained in:
Travis Watkins
2014-03-22 19:25:55 -05:00
parent 4873b12890
commit 019a33f50d
3 changed files with 14 additions and 3 deletions

View File

@@ -1850,7 +1850,7 @@ public class PlayerConnection implements PacketPlayInListener {
// CraftBukkit start - Add "isDisconnected" method
public final boolean isDisconnected() {
return !NetworkManager.a(this.networkManager).config().isAutoRead();
return !this.player.joining && !NetworkManager.a(this.networkManager).config().isAutoRead();
}
// CraftBukkit end
}