populate missing array value types in entity namespace

This commit is contained in:
Dylan K. Taylor 2020-01-30 20:50:24 +00:00
parent e61c3e8bf6
commit 839a789180
3 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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){