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

@ -26,7 +26,6 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\sound\DoorSound;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Bearing;
use pocketmine\math\Vector3;
use pocketmine\Player;
@ -70,7 +69,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::opposite($player->getDirection());
$this->meta = $player->getDirection();
}
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
@ -84,7 +83,7 @@ class FenceGate extends Transparent{
$this->meta = (($this->meta ^ 0x04) & ~0x02);
if($player !== null){
$this->meta |= (Bearing::opposite($player->getDirection()) & 0x02); //open towards the player, retaining axis
$this->meta |= ($player->getDirection() & 0x02); //open towards the player, retaining axis
}
$this->getLevel()->setBlock($this, $this, true);