From 839a789180cb3acd2e16006afa9b787903ffbbcd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 30 Jan 2020 20:50:24 +0000 Subject: [PATCH] populate missing array value types in entity namespace --- src/pocketmine/entity/DataPropertyManager.php | 4 ++++ src/pocketmine/entity/Entity.php | 5 ++++- src/pocketmine/entity/Living.php | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/entity/DataPropertyManager.php b/src/pocketmine/entity/DataPropertyManager.php index 48246853f..fb87f574b 100644 --- a/src/pocketmine/entity/DataPropertyManager.php +++ b/src/pocketmine/entity/DataPropertyManager.php @@ -176,6 +176,8 @@ class DataPropertyManager{ /** * Returns all properties. + * + * @return mixed[][] */ public function getAll() : array{ return $this->properties; @@ -183,6 +185,8 @@ class DataPropertyManager{ /** * Returns properties that have changed and need to be broadcasted. + * + * @return mixed[][] */ public function getDirty() : array{ return $this->dirtyProperties; diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 50bbdf12c..92efee83e 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -2055,7 +2055,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ /** * @param Player[]|Player $player - * @param array $data Properly formatted entity data, defaults to everything + * @param mixed[][] $data Properly formatted entity data, defaults to everything */ public function sendData($player, ?array $data = null) : void{ if(!is_array($player)){ @@ -2078,6 +2078,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } } + /** + * @param Player[]|null $players + */ public function broadcastEntityEvent(int $eventId, ?int $eventData = null, ?array $players = null) : void{ $pk = new ActorEventPacket(); $pk->entityRuntimeId = $this->id; diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 53f85467b..134781441 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -792,6 +792,8 @@ abstract class Living extends Entity implements Damageable{ } /** + * @param true[] $transparent + * * @return Block[] */ public function getLineOfSight(int $maxDistance, int $maxLength = 0, array $transparent = []) : array{ @@ -831,6 +833,9 @@ abstract class Living extends Entity implements Damageable{ return $blocks; } + /** + * @param true[] $transparent + */ public function getTargetBlock(int $maxDistance, array $transparent = []) : ?Block{ $line = $this->getLineOfSight($maxDistance, 1, $transparent); if(count($line) > 0){