mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Harden APIs which accept Vector3/Position/Location in event namespace
This commit is contained in:
@ -27,6 +27,7 @@ use pocketmine\entity\Location;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
class PlayerMoveEvent extends PlayerEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
@ -51,6 +52,7 @@ class PlayerMoveEvent extends PlayerEvent implements Cancellable{
|
||||
}
|
||||
|
||||
public function setTo(Location $to) : void{
|
||||
Utils::checkLocationNotInfOrNaN($to);
|
||||
$this->to = $to;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user