diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index 525734547..e802482eb 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -152,7 +152,7 @@ class Bed extends Transparent{ public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Facing::DOWN); if(!$down->isTransparent()){ - $this->meta = $player instanceof Player ? Bearing::rotate($player->getDirection(), 2) : 0; //rotate 180 degrees + $this->meta = $player instanceof Player ? Bearing::opposite($player->getDirection()) : 0; //rotate 180 degrees $next = $this->getSide(self::getOtherHalfSide($this->meta)); if($next->canBeReplaced() and !$next->getSide(Facing::DOWN)->isTransparent()){ parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 5a1942f8d..69fda8814 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -70,7 +70,7 @@ class FenceGate extends Transparent{ public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($player !== null){ - $this->meta = Bearing::rotate($player->getDirection(), 2); + $this->meta = Bearing::opposite($player->getDirection()); } return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); @@ -84,7 +84,7 @@ class FenceGate extends Transparent{ $this->meta = (($this->meta ^ 0x04) & ~0x02); if($player !== null){ - $this->meta |= (Bearing::rotate($player->getDirection(), 2) & 0x02); //open towards the player, retaining axis + $this->meta |= (Bearing::opposite($player->getDirection()) & 0x02); //open towards the player, retaining axis } $this->getLevel()->setBlock($this, $this, true);