mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-04 17:37:40 +02:00
Fixed the player receiving multiple self position packet
This commit is contained in:
parent
014bc8b0b5
commit
d7d610ffef
@ -749,7 +749,12 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
|
||||
if (firstSpawn) {
|
||||
this.position = getRespawnPoint();
|
||||
this.cacheX = position.getX();
|
||||
this.cacheY = position.getY();
|
||||
this.cacheZ = position.getZ();
|
||||
updatePlayerPosition();
|
||||
}
|
||||
|
||||
super.setInstance(instance);
|
||||
|
||||
PlayerSpawnEvent spawnEvent = new PlayerSpawnEvent(this, instance, firstSpawn);
|
||||
@ -1372,11 +1377,11 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
* <p>
|
||||
* Can be altered by the {@link PlayerRespawnEvent#setRespawnPosition(Position)}.
|
||||
*
|
||||
* @return the default respawn point
|
||||
* @return a copy of the default respawn point
|
||||
*/
|
||||
@NotNull
|
||||
public Position getRespawnPoint() {
|
||||
return respawnPoint;
|
||||
return respawnPoint.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user