mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
add typehints to Metadatable interface and implementations, fix missing return for Block->hasMetadata() reported in #1285
This commit is contained in:
@ -1872,19 +1872,19 @@ abstract class Entity extends Location implements Metadatable{
|
||||
$this->close();
|
||||
}
|
||||
|
||||
public function setMetadata($metadataKey, MetadataValue $metadataValue){
|
||||
public function setMetadata(string $metadataKey, MetadataValue $metadataValue){
|
||||
$this->server->getEntityMetadata()->setMetadata($this, $metadataKey, $metadataValue);
|
||||
}
|
||||
|
||||
public function getMetadata($metadataKey){
|
||||
public function getMetadata(string $metadataKey){
|
||||
return $this->server->getEntityMetadata()->getMetadata($this, $metadataKey);
|
||||
}
|
||||
|
||||
public function hasMetadata($metadataKey){
|
||||
public function hasMetadata(string $metadataKey) : bool{
|
||||
return $this->server->getEntityMetadata()->hasMetadata($this, $metadataKey);
|
||||
}
|
||||
|
||||
public function removeMetadata($metadataKey, Plugin $plugin){
|
||||
public function removeMetadata(string $metadataKey, Plugin $plugin){
|
||||
$this->server->getEntityMetadata()->removeMetadata($this, $metadataKey, $plugin);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user