mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if(!isset(self::$list[$this->getId()])){ //Unknown blocks
|
return [
|
||||||
return [];
|
[$this->getItemId(), $this->getDamage(), 1],
|
||||||
}else{
|
];
|
||||||
return [
|
|
||||||
[$this->getItemId(), $this->getDamage(), 1],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,9 +23,15 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
|
||||||
class UnknownBlock extends Transparent{
|
class UnknownBlock extends Transparent{
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item){
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user