treeType = $treeType; } public function getRequiredTypeDataBits() : int{ return 1; } protected function decodeType(BlockDataReader $r) : void{ $this->stripped = $r->readBool(); } protected function encodeType(BlockDataWriter $w) : void{ $w->writeBool($this->stripped); } /** * TODO: this is ad hoc, but add an interface for this to all tree-related blocks */ public function getTreeType() : TreeType{ return $this->treeType; } public function isStripped() : bool{ return $this->stripped; } /** @return $this */ public function setStripped(bool $stripped) : self{ $this->stripped = $stripped; return $this; } public function getFuelTime() : int{ return 300; } public function getFlameEncouragement() : int{ return 5; } public function getFlammability() : int{ return 5; } public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ if(!$this->stripped && $item instanceof Axe){ $item->applyDamage(1); $this->stripped = true; $this->position->getWorld()->setBlock($this->position, $this); return true; } return false; } }