diff --git a/src/pocketmine/block/Skull.php b/src/pocketmine/block/Skull.php index 9e4c6c425..3dfd1b04b 100644 --- a/src/pocketmine/block/Skull.php +++ b/src/pocketmine/block/Skull.php @@ -71,18 +71,20 @@ class Skull extends Flowable{ return true; } - public function getDropsForCompatibleTool(Item $item) : array{ + private function getItem() : Item{ $tile = $this->level->getTile($this); - if($tile instanceof TileSkull){ - return [ - ItemFactory::get(Item::SKULL, $tile->getType()) - ]; - } + return ItemFactory::get(Item::SKULL, $tile instanceof TileSkull ? $tile->getType() : 0); + } - return []; + public function getDropsForCompatibleTool(Item $item) : array{ + return [$this->getItem()]; } public function isAffectedBySilkTouch() : bool{ return false; } + + public function getPickedItem() : Item{ + return $this->getItem(); + } }