add typehints to Metadatable interface and implementations, fix missing return for Block->hasMetadata() reported in #1285

This commit is contained in:
Dylan K. Taylor
2017-08-10 18:02:01 +01:00
parent 82fd3b540e
commit e8bd0c3e09
6 changed files with 35 additions and 37 deletions

View File

@ -2907,20 +2907,20 @@ class Level implements ChunkManager, Metadatable{
}
}
public function setMetadata($metadataKey, MetadataValue $metadataValue){
$this->server->getLevelMetadata()->setMetadata($this, $metadataKey, $metadataValue);
public function setMetadata(string $metadataKey, MetadataValue $newMetadataValue){
$this->server->getLevelMetadata()->setMetadata($this, $metadataKey, $newMetadataValue);
}
public function getMetadata($metadataKey){
public function getMetadata(string $metadataKey){
return $this->server->getLevelMetadata()->getMetadata($this, $metadataKey);
}
public function hasMetadata($metadataKey){
public function hasMetadata(string $metadataKey) : bool{
return $this->server->getLevelMetadata()->hasMetadata($this, $metadataKey);
}
public function removeMetadata($metadataKey, Plugin $plugin){
$this->server->getLevelMetadata()->removeMetadata($this, $metadataKey, $plugin);
public function removeMetadata(string $metadataKey, Plugin $owningPlugin){
$this->server->getLevelMetadata()->removeMetadata($this, $metadataKey, $owningPlugin);
}
public function addEntityMotion(int $chunkX, int $chunkZ, int $entityId, float $x, float $y, float $z){