diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2014-03-22 19:25:55 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-03-22 19:39:03 -0500 |
commit | 019a33f50d3f0d34d5824bfd89688355ca4005b5 (patch) | |
tree | ea36116ea485a2255a8b2ba0def0d0fa0fb7d8d0 /src/main/java/net/minecraft/server/EntityPlayer.java | |
parent | 4873b12890e7af0c7137c3cb25853d6e20361cd4 (diff) | |
download | craftbukkit-019a33f50d3f0d34d5824bfd89688355ca4005b5.tar craftbukkit-019a33f50d3f0d34d5824bfd89688355ca4005b5.tar.gz craftbukkit-019a33f50d3f0d34d5824bfd89688355ca4005b5.tar.lz craftbukkit-019a33f50d3f0d34d5824bfd89688355ca4005b5.tar.xz craftbukkit-019a33f50d3f0d34d5824bfd89688355ca4005b5.zip |
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.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPlayer.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index d90ddb71..8d98a706 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -61,6 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int newTotalExp = 0; public boolean keepLevel = false; public double maxHealthCache; + public boolean joining = true; // CraftBukkit end public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { @@ -159,6 +160,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void h() { + // CraftBukkit start + if (this.joining) { + this.joining = false; + } + // CraftBukkit end + this.playerInteractManager.a(); --this.invulnerableTicks; if (this.noDamageTicks > 0) { |