mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
PlayerRespawnEvent: harden setRespawnPosition()
apparently plugins like to pass around positions which have null worlds, which aside from being quite stupid, also breaks a lot of stuff and makes it look like PM is to blame when it's just trying to make everything work the way it's supposed to ...
This commit is contained in:
parent
cd022f1592
commit
2b1a0e1e72
@ -43,6 +43,9 @@ class PlayerRespawnEvent extends PlayerEvent{
|
||||
}
|
||||
|
||||
public function setRespawnPosition(Position $position) : void{
|
||||
if(!$position->isValid()){
|
||||
throw new \InvalidArgumentException("Spawn position must reference a valid and loaded World");
|
||||
}
|
||||
$this->position = $position;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user