38 use StaticSupportTrait;
40 private bool $ready =
false;
43 $w->bool($this->ready);
46 public function isReady() : bool{ return $this->ready; }
48 public function setReady(
bool $ready) : self{
49 $this->ready = $ready;
53 private function canBeSupportedAt(Block $block) : bool{
54 return $block->getSide(Facing::DOWN)->getTypeId() === BlockTypeIds::FARMLAND;
57 private function getNextState() : Block{
59 return VanillaBlocks::TORCHFLOWER();
61 return VanillaBlocks::TORCHFLOWER_CROP()->setReady(
true);
67 if(BlockEventHelper::grow($this, $this->getNextState(), $player)){
83 BlockEventHelper::grow($this, $this->getNextState(),
null);