diff --git a/src/pocketmine/metadata/BlockMetadataStore.php b/src/pocketmine/metadata/BlockMetadataStore.php index 58adf2e54a..d60ce2c063 100644 --- a/src/pocketmine/metadata/BlockMetadataStore.php +++ b/src/pocketmine/metadata/BlockMetadataStore.php @@ -42,6 +42,12 @@ class BlockMetadataStore extends MetadataStore{ return $block->x . ":" . $block->y . ":" . $block->z . ":" . $metadataKey; } + /** + * @param Block $subject + * @param string $metadataKey + * + * @return MetadataValue[] + */ public function getMetadata(Block $subject, string $metadataKey){ return $this->getMetadataInternal($this->disambiguate($subject, $metadataKey)); } @@ -50,10 +56,24 @@ class BlockMetadataStore extends MetadataStore{ return $this->hasMetadataInternal($this->disambiguate($subject, $metadataKey)); } + /** + * @param Block $subject + * @param string $metadataKey + * @param Plugin $owningPlugin + * + * @return void + */ public function removeMetadata(Block $subject, string $metadataKey, Plugin $owningPlugin){ $this->removeMetadataInternal($this->disambiguate($subject, $metadataKey), $owningPlugin); } + /** + * @param Block $subject + * @param string $metadataKey + * @param MetadataValue $newMetadataValue + * + * @return void + */ public function setMetadata(Block $subject, string $metadataKey, MetadataValue $newMetadataValue){ $this->setMetadataInternal($this->disambiguate($subject, $metadataKey), $newMetadataValue); } diff --git a/src/pocketmine/metadata/EntityMetadataStore.php b/src/pocketmine/metadata/EntityMetadataStore.php index 681ecf7f24..fce6c267f0 100644 --- a/src/pocketmine/metadata/EntityMetadataStore.php +++ b/src/pocketmine/metadata/EntityMetadataStore.php @@ -32,6 +32,12 @@ class EntityMetadataStore extends MetadataStore{ return $entity->getId() . ":" . $metadataKey; } + /** + * @param Entity $subject + * @param string $metadataKey + * + * @return MetadataValue[] + */ public function getMetadata(Entity $subject, string $metadataKey){ return $this->getMetadataInternal($this->disambiguate($subject, $metadataKey)); } @@ -40,10 +46,24 @@ class EntityMetadataStore extends MetadataStore{ return $this->hasMetadataInternal($this->disambiguate($subject, $metadataKey)); } + /** + * @param Entity $subject + * @param string $metadataKey + * @param Plugin $owningPlugin + * + * @return void + */ public function removeMetadata(Entity $subject, string $metadataKey, Plugin $owningPlugin){ $this->removeMetadataInternal($this->disambiguate($subject, $metadataKey), $owningPlugin); } + /** + * @param Entity $subject + * @param string $metadataKey + * @param MetadataValue $newMetadataValue + * + * @return void + */ public function setMetadata(Entity $subject, string $metadataKey, MetadataValue $newMetadataValue){ $this->setMetadataInternal($this->disambiguate($subject, $metadataKey), $newMetadataValue); } diff --git a/src/pocketmine/metadata/LevelMetadataStore.php b/src/pocketmine/metadata/LevelMetadataStore.php index 790c5221ca..0b045f7ee7 100644 --- a/src/pocketmine/metadata/LevelMetadataStore.php +++ b/src/pocketmine/metadata/LevelMetadataStore.php @@ -33,6 +33,12 @@ class LevelMetadataStore extends MetadataStore{ return strtolower($level->getName()) . ":" . $metadataKey; } + /** + * @param Level $subject + * @param string $metadataKey + * + * @return MetadataValue[] + */ public function getMetadata(Level $subject, string $metadataKey){ return $this->getMetadataInternal($this->disambiguate($subject, $metadataKey)); } @@ -41,10 +47,24 @@ class LevelMetadataStore extends MetadataStore{ return $this->hasMetadataInternal($this->disambiguate($subject, $metadataKey)); } + /** + * @param Level $subject + * @param string $metadataKey + * @param Plugin $owningPlugin + * + * @return void + */ public function removeMetadata(Level $subject, string $metadataKey, Plugin $owningPlugin){ $this->removeMetadataInternal($this->disambiguate($subject, $metadataKey), $owningPlugin); } + /** + * @param Level $subject + * @param string $metadataKey + * @param MetadataValue $newMetadataValue + * + * @return void + */ public function setMetadata(Level $subject, string $metadataKey, MetadataValue $newMetadataValue){ $this->setMetadataInternal($this->disambiguate($subject, $metadataKey), $newMetadataValue); } diff --git a/src/pocketmine/metadata/MetadataStore.php b/src/pocketmine/metadata/MetadataStore.php index 7d2519c8a5..be3023198b 100644 --- a/src/pocketmine/metadata/MetadataStore.php +++ b/src/pocketmine/metadata/MetadataStore.php @@ -37,6 +37,8 @@ abstract class MetadataStore{ * * @param string $key * @param MetadataValue $newMetadataValue + * + * @return void */ protected function setMetadataInternal(string $key, MetadataValue $newMetadataValue){ $owningPlugin = $newMetadataValue->getOwningPlugin(); @@ -82,6 +84,8 @@ abstract class MetadataStore{ * * @param string $key * @param Plugin $owningPlugin + * + * @return void */ protected function removeMetadataInternal(string $key, Plugin $owningPlugin){ if(isset($this->metadataMap[$key])){ @@ -98,6 +102,8 @@ abstract class MetadataStore{ * be recalculated the next time it is accessed. * * @param Plugin $owningPlugin + * + * @return void */ public function invalidateAll(Plugin $owningPlugin){ /** @var \SplObjectStorage|MetadataValue[] $values */ diff --git a/src/pocketmine/metadata/MetadataValue.php b/src/pocketmine/metadata/MetadataValue.php index 6d3ab6d85c..46622002d7 100644 --- a/src/pocketmine/metadata/MetadataValue.php +++ b/src/pocketmine/metadata/MetadataValue.php @@ -50,6 +50,8 @@ abstract class MetadataValue{ /** * Invalidates this metadata item, forcing it to recompute when next * accessed. + * + * @return void */ abstract public function invalidate(); } diff --git a/src/pocketmine/metadata/Metadatable.php b/src/pocketmine/metadata/Metadatable.php index 802071b03f..ca74456f5c 100644 --- a/src/pocketmine/metadata/Metadatable.php +++ b/src/pocketmine/metadata/Metadatable.php @@ -32,6 +32,8 @@ interface Metadatable{ * * @param string $metadataKey * @param MetadataValue $newMetadataValue + * + * @return void */ public function setMetadata(string $metadataKey, MetadataValue $newMetadataValue); @@ -61,6 +63,8 @@ interface Metadatable{ * * @param string $metadataKey * @param Plugin $owningPlugin + * + * @return void */ public function removeMetadata(string $metadataKey, Plugin $owningPlugin); diff --git a/src/pocketmine/metadata/PlayerMetadataStore.php b/src/pocketmine/metadata/PlayerMetadataStore.php index 7c4fce37d9..dbea075b87 100644 --- a/src/pocketmine/metadata/PlayerMetadataStore.php +++ b/src/pocketmine/metadata/PlayerMetadataStore.php @@ -33,6 +33,12 @@ class PlayerMetadataStore extends MetadataStore{ return strtolower($player->getName()) . ":" . $metadataKey; } + /** + * @param IPlayer $subject + * @param string $metadataKey + * + * @return MetadataValue[] + */ public function getMetadata(IPlayer $subject, string $metadataKey){ return $this->getMetadataInternal($this->disambiguate($subject, $metadataKey)); } @@ -41,10 +47,24 @@ class PlayerMetadataStore extends MetadataStore{ return $this->hasMetadataInternal($this->disambiguate($subject, $metadataKey)); } + /** + * @param IPlayer $subject + * @param string $metadataKey + * @param Plugin $owningPlugin + * + * @return void + */ public function removeMetadata(IPlayer $subject, string $metadataKey, Plugin $owningPlugin){ $this->removeMetadataInternal($this->disambiguate($subject, $metadataKey), $owningPlugin); } + /** + * @param IPlayer $subject + * @param string $metadataKey + * @param MetadataValue $newMetadataValue + * + * @return void + */ public function setMetadata(IPlayer $subject, string $metadataKey, MetadataValue $newMetadataValue){ $this->setMetadataInternal($this->disambiguate($subject, $metadataKey), $newMetadataValue); }