diff --git a/src/entity/animation/ArmSwingAnimation.php b/src/entity/animation/ArmSwingAnimation.php index 8871415a2..d35b5cd4d 100644 --- a/src/entity/animation/ArmSwingAnimation.php +++ b/src/entity/animation/ArmSwingAnimation.php @@ -29,12 +29,8 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class ArmSwingAnimation implements Animation{ - /** @var Living */ - private $entity; //TODO: not sure if this should be constrained to humanoids, but we don't have any concept of that right now - - public function __construct(Living $entity){ - $this->entity = $entity; - } + //TODO: not sure if this should be constrained to humanoids, but we don't have any concept of that right now + public function __construct(private Living $entity){} public function encode() : array{ return [ diff --git a/src/entity/animation/ArrowShakeAnimation.php b/src/entity/animation/ArrowShakeAnimation.php index 256c6142b..3c9481ae1 100644 --- a/src/entity/animation/ArrowShakeAnimation.php +++ b/src/entity/animation/ArrowShakeAnimation.php @@ -29,15 +29,10 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; class ArrowShakeAnimation implements Animation{ - /** @var Arrow */ - private $arrow; - /** @var int */ - private $durationInTicks; - - public function __construct(Arrow $arrow, int $durationInTicks){ - $this->arrow = $arrow; - $this->durationInTicks = $durationInTicks; - } + public function __construct( + private Arrow $arrow, + private int $durationInTicks + ){} public function encode() : array{ return [ diff --git a/src/entity/animation/ConsumingItemAnimation.php b/src/entity/animation/ConsumingItemAnimation.php index b32f118bb..83ff1d5e7 100644 --- a/src/entity/animation/ConsumingItemAnimation.php +++ b/src/entity/animation/ConsumingItemAnimation.php @@ -31,16 +31,10 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class ConsumingItemAnimation implements Animation{ - /** @var Human */ - private $human; - /** @var Item */ - private $item; - - public function __construct(Human $human, Item $item){ - //TODO: maybe this can be expanded to more than just player entities? - $this->human = $human; - $this->item = $item; - } + public function __construct( + private Human $human, //TODO: maybe this can be expanded to more than just player entities? + private Item $item + ){} public function encode() : array{ [$netId, $netData] = ItemTranslator::getInstance()->toNetworkId($this->item->getId(), $this->item->getMeta()); diff --git a/src/entity/animation/CriticalHitAnimation.php b/src/entity/animation/CriticalHitAnimation.php index f3a588b79..23a114093 100644 --- a/src/entity/animation/CriticalHitAnimation.php +++ b/src/entity/animation/CriticalHitAnimation.php @@ -28,12 +28,7 @@ use pocketmine\network\mcpe\protocol\AnimatePacket; final class CriticalHitAnimation implements Animation{ - /** @var Living */ - private $entity; - - public function __construct(Living $entity){ - $this->entity = $entity; - } + public function __construct(private Living $entity){} public function encode() : array{ return [ diff --git a/src/entity/animation/DeathAnimation.php b/src/entity/animation/DeathAnimation.php index a3a924413..2ef72634b 100644 --- a/src/entity/animation/DeathAnimation.php +++ b/src/entity/animation/DeathAnimation.php @@ -29,12 +29,7 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class DeathAnimation implements Animation{ - /** @var Living */ - private $entity; - - public function __construct(Living $entity){ - $this->entity = $entity; - } + public function __construct(private Living $entity){} public function encode() : array{ return [ diff --git a/src/entity/animation/HurtAnimation.php b/src/entity/animation/HurtAnimation.php index 355b49d47..d179f2f96 100644 --- a/src/entity/animation/HurtAnimation.php +++ b/src/entity/animation/HurtAnimation.php @@ -29,12 +29,7 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class HurtAnimation implements Animation{ - /** @var Living */ - private $entity; - - public function __construct(Living $entity){ - $this->entity = $entity; - } + public function __construct(private Living $entity){} public function encode() : array{ return [ diff --git a/src/entity/animation/RespawnAnimation.php b/src/entity/animation/RespawnAnimation.php index e8466e26e..89bd590e4 100644 --- a/src/entity/animation/RespawnAnimation.php +++ b/src/entity/animation/RespawnAnimation.php @@ -29,12 +29,7 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class RespawnAnimation implements Animation{ - /** @var Living */ - private $entity; - - public function __construct(Living $entity){ - $this->entity = $entity; - } + public function __construct(private Living $entity){} public function encode() : array{ return [ diff --git a/src/entity/animation/SquidInkCloudAnimation.php b/src/entity/animation/SquidInkCloudAnimation.php index 6ae728a79..540875f38 100644 --- a/src/entity/animation/SquidInkCloudAnimation.php +++ b/src/entity/animation/SquidInkCloudAnimation.php @@ -29,12 +29,7 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class SquidInkCloudAnimation implements Animation{ - /** @var Squid */ - private $squid; - - public function __construct(Squid $squid){ - $this->squid = $squid; - } + public function __construct(private Squid $squid){} public function encode() : array{ return [ diff --git a/src/entity/animation/TotemUseAnimation.php b/src/entity/animation/TotemUseAnimation.php index ec0d3b12c..d416e186d 100644 --- a/src/entity/animation/TotemUseAnimation.php +++ b/src/entity/animation/TotemUseAnimation.php @@ -29,13 +29,8 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class TotemUseAnimation implements Animation{ - /** @var Human */ - private $human; - - public function __construct(Human $human){ - //TODO: check if this can be expanded to more than just humans - $this->human = $human; - } + //TODO: check if this can be expanded to more than just humans + public function __construct(private Human $human){} public function encode() : array{ return [