22declare(strict_types=1);
24namespace pocketmine\block\utils;
32trait MultiAnyFacingTrait{
35 protected array $faces = [];
37 protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
38 $w->facingFlags($this->faces);
42 public function getFaces() : array{ return $this->faces; }
44 public function hasFace(
int $face) : bool{
45 return isset($this->faces[$face]);
52 public function setFaces(array $faces) : self{
54 foreach($faces as $face){
55 Facing::validate($face);
56 $uniqueFaces[$face] = $face;
58 $this->faces = $uniqueFaces;
63 public function setFace(
int $face,
bool $value) : self{
64 Facing::validate($face);
66 $this->faces[$face] = $face;
68 unset($this->faces[$face]);