Fixed mushroom blocks for PM5

closes #5284
This commit is contained in:
Dylan K. Taylor 2023-03-15 16:54:13 +00:00
parent 4ba4d556ed
commit 72853677bb
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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();
}
}