mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
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:
1 parent
4873b12890
commit
019a33f50d
3 files changed
+14
-3
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user