meta = $meta; } public function getHardness(){ return 1; } public function isSolid(){ return false; } public function getName(){ return "Sign Post"; } public function getBoundingBox(){ return null; } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ if($face !== 0){ $nbt = new CompoundTag("", [ "id" => new StringTag("id", Tile::SIGN), "x" => new IntTag("x", $block->x), "y" => new IntTag("y", $block->y), "z" => new IntTag("z", $block->z), "Text1" => new StringTag("Text1", ""), "Text2" => new StringTag("Text2", ""), "Text3" => new StringTag("Text3", ""), "Text4" => new StringTag("Text4", "") ]); if($player !== null){ $nbt->Creator = new StringTag("Creator", $player->getRawUniqueId()); } if($item->hasCustomBlockData()){ foreach($item->getCustomBlockData() as $key => $v){ $nbt->{$key} = $v; } } if($face === 1){ $this->meta = floor((($player->yaw + 180) * 16 / 360) + 0.5) & 0x0f; $this->getLevel()->setBlock($block, $this, true); }else{ $this->meta = $face; $this->getLevel()->setBlock($block, new WallSign($this->meta), true); } Tile::createTile(Tile::SIGN, $this->getLevel(), $nbt); return true; } return false; } public function onUpdate($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; } public function getDrops(Item $item){ return [ [Item::SIGN, 0, 1], ]; } public function getToolType(){ return Tool::TYPE_AXE; } }