mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
parent
4ba4d556ed
commit
72853677bb
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user