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:
@ -26,6 +26,7 @@ namespace pocketmine\event\entity;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\utils\Utils;
|
||||
use pocketmine\world\Position;
|
||||
|
||||
/**
|
||||
@ -54,6 +55,7 @@ class EntityTeleportEvent extends EntityEvent implements Cancellable{
|
||||
}
|
||||
|
||||
public function setTo(Position $to) : void{
|
||||
Utils::checkVector3NotInfOrNaN($to);
|
||||
$this->to = $to;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user