mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Modernize Position and Location
[bc break]
This commit is contained in:
parent
7b8eeb42f6
commit
2bb99fa677
@ -29,10 +29,8 @@ use pocketmine\world\World;
|
|||||||
|
|
||||||
class Location extends Position{
|
class Location extends Position{
|
||||||
|
|
||||||
/** @var float */
|
public float $yaw;
|
||||||
public $yaw;
|
public float $pitch;
|
||||||
/** @var float */
|
|
||||||
public $pitch;
|
|
||||||
|
|
||||||
public function __construct(float $x, float $y, float $z, ?World $world, float $yaw, float $pitch){
|
public function __construct(float $x, float $y, float $z, ?World $world, float $yaw, float $pitch){
|
||||||
$this->yaw = $yaw;
|
$this->yaw = $yaw;
|
||||||
|
@ -28,16 +28,9 @@ use pocketmine\utils\AssumptionFailedError;
|
|||||||
use function assert;
|
use function assert;
|
||||||
|
|
||||||
class Position extends Vector3{
|
class Position extends Vector3{
|
||||||
|
public ?World $world = null;
|
||||||
|
|
||||||
/** @var World|null */
|
public function __construct(float|int $x, float|int $y, float|int $z, ?World $world){
|
||||||
public $world = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param float|int $x
|
|
||||||
* @param float|int $y
|
|
||||||
* @param float|int $z
|
|
||||||
*/
|
|
||||||
public function __construct($x, $y, $z, ?World $world){
|
|
||||||
parent::__construct($x, $y, $z);
|
parent::__construct($x, $y, $z);
|
||||||
if($world !== null && !$world->isLoaded()){
|
if($world !== null && !$world->isLoaded()){
|
||||||
throw new \InvalidArgumentException("Specified world has been unloaded and cannot be used");
|
throw new \InvalidArgumentException("Specified world has been unloaded and cannot be used");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user