mushroomBlockType = MushroomBlockType::PORES(); parent::__construct($idInfo, $name, $breakInfo); } public function getRequiredStateDataBits() : int{ return 4; } protected function decodeState(RuntimeDataReader $r) : void{ $this->mushroomBlockType = RuntimeEnumDeserializer::readMushroomBlockType($r); } protected function encodeState(RuntimeDataWriter $w) : void{ RuntimeEnumSerializer::writeMushroomBlockType($w, $this->mushroomBlockType); } 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; } }