mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
@@ -32,11 +32,13 @@ class RedMushroomBlock extends Opaque{
|
||||
protected MushroomBlockType $mushroomBlockType;
|
||||
|
||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
|
||||
$this->mushroomBlockType = MushroomBlockType::PORES();
|
||||
$this->mushroomBlockType = MushroomBlockType::ALL_CAP();
|
||||
parent::__construct($idInfo, $name, $typeInfo);
|
||||
}
|
||||
|
||||
protected function describeState(RuntimeDataDescriber $w) : void{
|
||||
protected function describeType(RuntimeDataDescriber $w) : void{
|
||||
//these blocks always drop as all-cap, but may exist in other forms in the inventory (particularly creative),
|
||||
//so this information needs to be kept in the type info
|
||||
$w->mushroomBlockType($this->mushroomBlockType);
|
||||
}
|
||||
|
||||
@@ -57,4 +59,12 @@ class RedMushroomBlock extends Opaque{
|
||||
public function isAffectedBySilkTouch() : bool{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getSilkTouchDrops(Item $item) : array{
|
||||
return [(clone $this)->setMushroomBlockType(MushroomBlockType::ALL_CAP())->asItem()];
|
||||
}
|
||||
|
||||
public function getPickedItem(bool $addUserData = false) : Item{
|
||||
return (clone $this)->setMushroomBlockType(MushroomBlockType::ALL_CAP())->asItem();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user