mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Modernize property declarations in src/entity/animation
This commit is contained in:
parent
b88a47929f
commit
20ff5d5a3d
@ -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 [
|
||||
|
@ -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 [
|
||||
|
@ -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());
|
||||
|
@ -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 [
|
||||
|
@ -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 [
|
||||
|
@ -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 [
|
||||
|
@ -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 [
|
||||
|
@ -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 [
|
||||
|
@ -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 [
|
||||
|
Loading…
x
Reference in New Issue
Block a user