Hello i have this: PHP: $pos->getLevel()->setBlock(new Position($pos->x, $pos->y, $pos->z, $pos->getLevel()), $block, false, false); $block2 are the id of the stair that i want: "134" and i want to set the rotation of the stair to top, right, left, or bottom, so how can i do that? I have see on this: https://github.com/pmmp/PocketMine-...1630823b7b/src/pocketmine/block/Stair.php#L92 but i don't know how to do this whitout need that the player is looking to top or bottom on yaw..
Hi, the first 2 bits of metadata are for the stairs rotation, and with the third bit you can set vertical rotation to the top or bottom.
PHP: $meta = $block->getDamage();$meta &= 0x00; //one of horizontal rotations$meta &= 0x01; //one of horizontal rotations$meta &= 0x02; //one of horizontal rotations$meta &= 0x03; //one of horizontal rotations//you can change horizontal direction with$meta ^= 0x04; //change vertical rotation should work
Hello, but how can i indetify the meta to an block? Because i get the block by using this: PHP: $block = Item::fromString("136:0")->getBlock(); $this->getServer()->getLevelByName($level)->setBlock(new Position($x, $y, $z, $this->getServer()->getLevelByName($level)), $block, false, false); So, who can i set the meta to this?