bool($this->ready); } public function isReady() : bool{ return $this->ready; } public function setReady(bool $ready) : self{ $this->ready = $ready; return $this; } private function canBeSupportedAt(Block $block) : bool{ return $block->getSide(Facing::DOWN)->getTypeId() === BlockTypeIds::FARMLAND; } private function getNextState() : Block{ if($this->ready){ return VanillaBlocks::TORCHFLOWER(); }else{ return VanillaBlocks::TORCHFLOWER_CROP()->setReady(true); } } public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ if($item instanceof Fertilizer){ if(BlockEventHelper::grow($this, $this->getNextState(), $player)){ $item->pop(); } return true; } return false; } public function ticksRandomly() : bool{ return true; } public function onRandomTick() : void{ if(CropGrowthHelper::canGrow($this)){ BlockEventHelper::grow($this, $this->getNextState(), null); } } public function asItem() : Item{ return VanillaItems::TORCHFLOWER_SEEDS(); } }