Make use of Bearing::opposite()

This commit is contained in:
Dylan K. Taylor
2018-09-13 19:35:47 +01:00
parent f488e594f6
commit 2b8405e6ee
2 changed files with 3 additions and 3 deletions

View File

@ -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);