mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Location: make __construct() parameters mandatory
I did consider allowing yaw/pitch to remain optional, but considering the implicit immutability of Location, it really doesn't make any sense to create a Location with default yaw/pitch - just create a Position in that case instead.
This commit is contained in:
parent
88b7389080
commit
ee9f5e0044
@ -34,7 +34,7 @@ class Location extends Position{
|
||||
/** @var float */
|
||||
public $pitch;
|
||||
|
||||
public function __construct(float $x, float $y, float $z, float $yaw = 0.0, float $pitch = 0.0, ?World $world = null){
|
||||
public function __construct(float $x, float $y, float $z, float $yaw, float $pitch, ?World $world){
|
||||
$this->yaw = $yaw;
|
||||
$this->pitch = $pitch;
|
||||
parent::__construct($x, $y, $z, $world);
|
||||
|
Loading…
x
Reference in New Issue
Block a user