Fixed mushroom block silk-touch drops and block picking behaviour

fixes #5284
This commit is contained in:
Dylan K. Taylor 2023-03-15 16:36:05 +00:00
parent b266f45152
commit 5f9e0081fd
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -34,7 +34,7 @@ class RedMushroomBlock extends Opaque{
protected MushroomBlockType $mushroomBlockType;
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $breakInfo){
$this->mushroomBlockType = MushroomBlockType::PORES();
$this->mushroomBlockType = MushroomBlockType::ALL_CAP();
parent::__construct($idInfo, $name, $breakInfo);
}
@ -42,6 +42,11 @@ class RedMushroomBlock extends Opaque{
return MushroomBlockTypeIdMap::getInstance()->toId($this->mushroomBlockType);
}
protected function writeStateToItemMeta() : int{
//these blocks always drop as all-cap, but may exist in other forms in the inventory (particularly creative)
return BlockLegacyMetadata::MUSHROOM_BLOCK_ALL_CAP;
}
public function readStateFromData(int $id, int $stateMeta) : void{
$type = MushroomBlockTypeIdMap::getInstance()->fromId($stateMeta);
if($type === null){