mushroomBlockType = MushroomBlockType::PORES(); parent::__construct($idInfo, $name, $breakInfo); } protected function writeStateToMeta() : int{ return MushroomBlockTypeIdMap::getInstance()->toId($this->mushroomBlockType); } public function readStateFromData(int $id, int $stateMeta) : void{ $type = MushroomBlockTypeIdMap::getInstance()->fromId($stateMeta); if($type === null){ throw new InvalidBlockStateException("No such mushroom variant $stateMeta"); } $this->mushroomBlockType = $type; } public function getStateBitmask() : int{ return 0b1111; } public function getMushroomBlockType() : MushroomBlockType{ return $this->mushroomBlockType; } /** @return $this */ public function setMushroomBlockType(MushroomBlockType $mushroomBlockType) : self{ $this->mushroomBlockType = $mushroomBlockType; return $this; } public function getDropsForCompatibleTool(Item $item) : array{ return [ VanillaBlocks::RED_MUSHROOM()->asItem()->setCount(mt_rand(0, 2)) ]; } public function isAffectedBySilkTouch() : bool{ return true; } }