Fixed mess of rotations being inverted

This commit is contained in:
Dylan K. Taylor
2018-09-16 17:37:36 +01:00
parent f7f06c993d
commit 1bb4daa7d1
11 changed files with 21 additions and 31 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::opposite($player->getDirection()) : 0; //rotate 180 degrees
$this->meta = $player instanceof Player ? $player->getDirection() : 0;
$next = $this->getSide(self::getOtherHalfSide($this->meta));
if($next->canBeReplaced() and !$next->getSide(Facing::DOWN)->isTransparent()){
parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);