Skip to content

RedstoneComparator ​

class · pocketmine\block\RedstoneComparator · source

Extends Flowable
Implements AnalogRedstoneSignalEmitter, PoweredByRedstone, HorizontalFacing

Properties ​

$isSubtractMode protected ​

php
protected bool $isSubtractMode

Methods ​

calculateOutput() 5.46.0 ​

php
public static function calculateOutput(int $rear, int $side, bool $subtract) : int

Computes the output of a comparator from its rear and (highest) side inputs.

describeBlockOnlyState() protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getOutputFace() 5.46.0 ​

php
public function getOutputFace() : int

The comparator reads the block on its facing side and outputs on the opposite side.

getStrongPower() 5.46.0 ​

php
public function getStrongPower(int $face) : int

getWeakPower() 5.46.0 ​

php
public function getWeakPower(int $face) : int

isRedstoneSource() 5.46.0 ​

php
public function isRedstoneSource() : bool

isSubtractMode() ​

php
public function isSubtractMode() : bool

onBreak() 5.46.0 ​

php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onInteract() ​

php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onNearbyBlockChange() 5.46.0 ​

php
public function onNearbyBlockChange() : void

onScheduledUpdate() 5.46.0 ​

php
public function onScheduledUpdate() : void

place() ​

php
public function place(\pocketmine\world\BlockTransaction $tx, \pocketmine\item\Item $item, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null) : bool

readComparatorOutput() 5.46.0 ​

php
public static function readComparatorOutput(\pocketmine\block\Block $block) : ?int

Returns the comparator output of a block (container fullness, cake slices...), or null if it has none.

readStateFromWorld() ​

php
public function readStateFromWorld() : \pocketmine\block\Block

recalculateCollisionBoxes() protected ​

php
protected function recalculateCollisionBoxes() : array

setSubtractMode() ​

php
public function setSubtractMode(bool $isSubtractMode) : self

writeStateToWorld() ​

php
public function writeStateToWorld() : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.