mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Fixed unknown blocks dropping themselves
This commit is contained in:
parent
6320a63ca5
commit
f6c31680f6
@ -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],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 [];
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user