From f6c31680f651f4f27e75adde4df6ea424452478d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 17 Aug 2017 13:25:11 +0100 Subject: [PATCH] Fixed unknown blocks dropping themselves --- src/pocketmine/block/Block.php | 10 +++------- src/pocketmine/block/UnknownBlock.php | 6 ++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 1342eaf08..7663737cd 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -659,13 +659,9 @@ class Block extends Position implements BlockIds, Metadatable{ * @return array */ public function getDrops(Item $item){ - if(!isset(self::$list[$this->getId()])){ //Unknown blocks - return []; - }else{ - return [ - [$this->getItemId(), $this->getDamage(), 1], - ]; - } + return [ + [$this->getItemId(), $this->getDamage(), 1], + ]; } /** diff --git a/src/pocketmine/block/UnknownBlock.php b/src/pocketmine/block/UnknownBlock.php index d8e2d58b8..16088afdd 100644 --- a/src/pocketmine/block/UnknownBlock.php +++ b/src/pocketmine/block/UnknownBlock.php @@ -23,9 +23,15 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\item\Item; + class UnknownBlock extends Transparent{ public function getHardness(){ return 0; } + + public function getDrops(Item $item){ + return []; + } } \ No newline at end of file