Use typed properties in src/entity package

[bc break]
This commit is contained in:
Dylan K. Taylor
2022-06-01 21:19:02 +01:00
parent 2029e3be20
commit 7b8eeb42f6
16 changed files with 160 additions and 284 deletions

View File

@ -52,20 +52,11 @@ class Arrow extends Projectile{
private const TAG_PICKUP = "pickup"; //TAG_Byte
public const TAG_CRIT = "crit"; //TAG_Byte
/** @var float */
protected $damage = 2.0;
/** @var int */
protected $pickupMode = self::PICKUP_ANY;
/** @var float */
protected $punchKnockback = 0.0;
/** @var int */
protected $collideTicks = 0;
/** @var bool */
protected $critical = false;
protected float $damage = 2.0;
protected int $pickupMode = self::PICKUP_ANY;
protected float $punchKnockback = 0.0;
protected int $collideTicks = 0;
protected bool $critical = false;
public function __construct(Location $location, ?Entity $shootingEntity, bool $critical, ?CompoundTag $nbt = null){
parent::__construct($location, $shootingEntity, $nbt);

View File

@ -51,11 +51,8 @@ use const PHP_INT_MAX;
abstract class Projectile extends Entity{
/** @var float */
protected $damage = 0.0;
/** @var Block|null */
protected $blockHit;
protected float $damage = 0.0;
protected ?Block $blockHit = null;
public function __construct(Location $location, ?Entity $shootingEntity, ?CompoundTag $nbt = null){
parent::__construct($location, $nbt);

View File

@ -52,8 +52,7 @@ class SplashPotion extends Throwable{
public static function getNetworkTypeId() : string{ return EntityIds::SPLASH_POTION; }
/** @var bool */
protected $linger = false;
protected bool $linger = false;
protected PotionType $potionType;
public function __construct(Location $location, ?Entity $shootingEntity, PotionType $potionType, ?CompoundTag $nbt = null){