mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed players respawning in the wrong world
add() returns a Vector3 instance, not a Position instance... argh
This commit is contained in:
parent
eab7b93483
commit
20d2ef9d38
@ -2682,7 +2682,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerRespawnEvent($this, $this->getSpawn()));
|
||||
|
||||
$realSpawn = $ev->getRespawnPosition()->add(0.5, 0, 0.5);
|
||||
$realSpawn = Position::fromObject($ev->getRespawnPosition()->add(0.5, 0, 0.5), $ev->getRespawnPosition()->getLevel());
|
||||
|
||||
if($realSpawn->distanceSquared($this->getSpawn()->add(0.5, 0, 0.5)) > 0.01){
|
||||
$this->teleport($realSpawn); //If the destination was modified by plugins
|
||||
|
Loading…
x
Reference in New Issue
Block a user