Clean up item handling of blocks

This commit is contained in:
Dylan K. Taylor
2018-09-23 14:21:37 +01:00
parent ed1c511c3c
commit 1427da0aeb
3 changed files with 10 additions and 23 deletions

View File

@ -184,17 +184,13 @@ class Bed extends Transparent{
public function getDropsForCompatibleTool(Item $item) : array{
if($this->isHeadPart()){
return [$this->getItem()];
return parent::getDropsForCompatibleTool($item);
}
return [];
}
public function getPickedItem() : Item{
return $this->getItem();
}
private function getItem() : Item{
public function getItem() : Item{
$tile = $this->getLevel()->getTile($this);
if($tile instanceof TileBed){
return ItemFactory::get($this->getItemId(), $tile->getColor());