mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Entity: add getHorizontalFacing(), clean up some boilerplate code
This commit is contained in:
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\Bearing;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
|
||||
@ -94,7 +93,7 @@ class Lever extends Flowable{
|
||||
|
||||
if(Facing::axis($face) === Facing::AXIS_Y){
|
||||
if($player !== null){
|
||||
$this->facing = Bearing::toFacing(Bearing::opposite($player->getDirection()));
|
||||
$this->facing = Facing::opposite($player->getHorizontalFacing());
|
||||
}
|
||||
$this->position = $face === Facing::DOWN ? self::BOTTOM : self::TOP;
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user