mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Implemented asVector3(), asPosition() and asLocation()
Squash merge, closes #973
This commit is contained in:
@ -46,6 +46,15 @@ class Position extends Vector3{
|
||||
return new Position($pos->x, $pos->y, $pos->z, $level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a Position instance
|
||||
*
|
||||
* @return Position
|
||||
*/
|
||||
public function asPosition() : Position{
|
||||
return new Position($this->x, $this->y, $this->z, $this->level);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target Level, or null if the target is not valid.
|
||||
* If a reference exists to a Level which is closed, the reference will be destroyed and null will be returned.
|
||||
|
Reference in New Issue
Block a user