Fixed unknown blocks dropping themselves

This commit is contained in:
Dylan K. Taylor 2017-08-17 13:25:11 +01:00
parent 6320a63ca5
commit f6c31680f6
2 changed files with 9 additions and 7 deletions

View File

@ -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],
];
}
/**

View File

@ -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 [];
}
}