Update for pocketmine/math Axis refactor

This commit is contained in:
Dylan K. Taylor
2020-08-06 14:38:31 +01:00
parent 7399e6944e
commit 2b044195a5
17 changed files with 50 additions and 37 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\block;
use pocketmine\block\utils\BlockDataSerializer;
use pocketmine\item\Item;
use pocketmine\math\Axis;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
@ -50,9 +51,9 @@ class Lever extends Flowable{
protected function writeStateToMeta() : int{
if($this->leverPos === self::BOTTOM){
$rotationMeta = Facing::axis($this->facing) === Facing::AXIS_Z ? 7 : 0;
$rotationMeta = Facing::axis($this->facing) === Axis::Z ? 7 : 0;
}elseif($this->leverPos === self::TOP){
$rotationMeta = Facing::axis($this->facing) === Facing::AXIS_Z ? 5 : 6;
$rotationMeta = Facing::axis($this->facing) === Axis::Z ? 5 : 6;
}else{
$rotationMeta = 6 - BlockDataSerializer::writeHorizontalFacing($this->facing);
}
@ -84,7 +85,7 @@ class Lever extends Flowable{
return false;
}
if(Facing::axis($face) === Facing::AXIS_Y){
if(Facing::axis($face) === Axis::Y){
if($player !== null){
$this->facing = Facing::opposite($player->getHorizontalFacing());
}