Block: Rename getItem() to asItem()

this has clearer meaning and is less likely to collide with other things.
This commit is contained in:
Dylan K. Taylor
2019-02-24 10:23:40 +00:00
parent ff35736bf9
commit 0bd1c1529e
7 changed files with 10 additions and 10 deletions

View File

@ -107,7 +107,7 @@ class Block extends Position implements BlockIds, Metadatable{
return $this->idInfo->getBlockId();
}
public function getItem() : Item{
public function asItem() : Item{
return ItemFactory::get($this->idInfo->getItemId(), $this->idInfo->getVariant());
}
@ -511,7 +511,7 @@ class Block extends Position implements BlockIds, Metadatable{
* @return Item[]
*/
public function getDropsForCompatibleTool(Item $item) : array{
return [$this->getItem()];
return [$this->asItem()];
}
/**
@ -522,7 +522,7 @@ class Block extends Position implements BlockIds, Metadatable{
* @return Item[]
*/
public function getSilkTouchDrops(Item $item) : array{
return [$this->getItem()];
return [$this->asItem()];
}
/**
@ -564,7 +564,7 @@ class Block extends Position implements BlockIds, Metadatable{
* @return Item
*/
public function getPickedItem() : Item{
return $this->getItem();
return $this->asItem();
}
/**