meta = $meta; } public function getHardness() : float{ return 0.1; } public function isSolid() : bool{ return true; } public function getName() : string{ return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Carpet"; } protected function recalculateBoundingBox(){ return new AxisAlignedBB( $this->x, $this->y, $this->z, $this->x + 1, $this->y + 0.0625, $this->z + 1 ); } public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() !== self::AIR){ $this->getLevel()->setBlock($blockReplace, $this, true, true); return true; } return false; } public function onUpdate(int $type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(Vector3::SIDE_DOWN)->getId() === self::AIR){ $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } } return false; } }