mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
block: added HorizontalFacingTrait and AnyFacingTrait
these are primarily intended for deduplication of code and ability to cross-reference. Don't expect this API to remain the same.
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\tile\Comparator;
|
||||
use pocketmine\block\utils\BlockDataSerializer;
|
||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
@ -34,11 +35,11 @@ use pocketmine\world\BlockTransaction;
|
||||
use function assert;
|
||||
|
||||
class RedstoneComparator extends Flowable{
|
||||
use HorizontalFacingTrait;
|
||||
|
||||
/** @var BlockIdentifierFlattened */
|
||||
protected $idInfo;
|
||||
|
||||
/** @var int */
|
||||
protected $facing = Facing::NORTH;
|
||||
/** @var bool */
|
||||
protected $isSubtractMode = false;
|
||||
/** @var bool */
|
||||
@ -85,20 +86,6 @@ class RedstoneComparator extends Flowable{
|
||||
$tile->setSignalStrength($this->signalStrength);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: ad hoc, move to interface
|
||||
*/
|
||||
public function getFacing() : int{
|
||||
return $this->facing;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: ad hoc, move to interface
|
||||
*/
|
||||
public function setFacing(int $facing) : void{
|
||||
$this->facing = $facing;
|
||||
}
|
||||
|
||||
public function isSubtractMode() : bool{
|
||||
return $this->isSubtractMode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user