meta = $meta; } public function getHardness() : float{ return 0.5; } public function getToolType() : int{ return BlockToolType::TYPE_SHOVEL; } public function getName() : string{ if($this->meta === 1){ return "Coarse Dirt"; } return "Dirt"; } public function onActivate(Item $item, Player $player = null) : bool{ if($item instanceof Hoe){ $item->applyDamage(1); if($this->meta === 1){ $this->getLevelNonNull()->setBlock($this, BlockFactory::get(Block::DIRT), true); }else{ $this->getLevelNonNull()->setBlock($this, BlockFactory::get(Block::FARMLAND), true); } return true; } return false; } }