mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
NBT is no longer needed to create an entity
it's still able to be provided, but shouldn't be needed in the majority of cases (constructor args and/or API methods should be sufficient).
This commit is contained in:
@ -71,7 +71,7 @@ class Arrow extends Projectile{
|
||||
/** @var bool */
|
||||
protected $critical = false;
|
||||
|
||||
public function __construct(Location $location, ?Entity $shootingEntity, bool $critical, CompoundTag $nbt){
|
||||
public function __construct(Location $location, ?Entity $shootingEntity, bool $critical, ?CompoundTag $nbt = null){
|
||||
parent::__construct($location, $shootingEntity, $nbt);
|
||||
$this->setCritical($critical);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ abstract class Projectile extends Entity{
|
||||
/** @var Block|null */
|
||||
protected $blockHit;
|
||||
|
||||
public function __construct(Location $location, ?Entity $shootingEntity, CompoundTag $nbt){
|
||||
public function __construct(Location $location, ?Entity $shootingEntity, ?CompoundTag $nbt = null){
|
||||
parent::__construct($location, $nbt);
|
||||
if($shootingEntity !== null){
|
||||
$this->setOwningEntity($shootingEntity);
|
||||
|
||||
Reference in New Issue
Block a user