22declare(strict_types=1);
24namespace pocketmine\block\utils;
28use
function spl_object_id;
33trait MultiAnyFacingTrait{
36 protected array $faces = [];
38 protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
39 $w->enumSet($this->faces,
Facing::cases());
43 public function getFaces() : array{ return $this->faces; }
45 public function hasFace(
Facing $face) : bool{
46 return isset($this->faces[spl_object_id($face)]);
53 public function setFaces(array $faces) : self{
55 foreach($faces as $face){
56 $uniqueFaces[spl_object_id($face)] = $face;
58 $this->faces = $uniqueFaces;
63 public function setFace(
Facing $face,
bool $value) : self{
65 $this->faces[spl_object_id($face)] = $face;
67 unset($this->faces[spl_object_id($face)]);