mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Harden APIs which accept Vector3/Position/Location in event namespace
This commit is contained in:
@ -27,6 +27,7 @@ use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
class BlockTeleportEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
@ -44,6 +45,7 @@ class BlockTeleportEvent extends BlockEvent implements Cancellable{
|
||||
}
|
||||
|
||||
public function setTo(Vector3 $to) : void{
|
||||
Utils::checkVector3NotInfOrNaN($to);
|
||||
$this->to = $to;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user