Observer 5.46.0
Extends Opaque
Implements AnyFacing
Watches the block in front of it (its facing) and, one redstone tick after that block's state changes, emits a one redstone tick pulse of strong power out of its back.
Changes are reported by the redstone engine (RedstoneEngine::notifyObservers()), which looks at the six neighbours of each changed block. Two observers facing each other make a clock, paced by the scheduled updates.
Constants
DELAY_TICKS
php
public const DELAY_TICKS = \pocketmine\world\redstone\RedstoneEngine::REDSTONE_TICKPULSE_TICKS
php
public const PULSE_TICKS = \pocketmine\world\redstone\RedstoneEngine::REDSTONE_TICKMethods
connectsToRedstoneWire()
php
public function connectsToRedstoneWire(int $face) : booldescribeBlockOnlyState() protected
php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetOutputFace()
php
public function getOutputFace() : intReturns the side out of which the observer emits its pulse.
getStrongPower()
php
public function getStrongPower(int $face) : intgetWeakPower()
php
public function getWeakPower(int $face) : intisRedstoneConductor()
php
public function isRedstoneConductor() : boolisRedstoneSource()
php
public function isRedstoneSource() : boolonBreak()
php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonNearbyBlockChange()
php
public function onNearbyBlockChange() : voidonObservedBlockChange()
php
public function onObservedBlockChange() : voidCalled by the redstone engine when the watched block changes.
onScheduledUpdate()
php
public function onScheduledUpdate() : voidplace()
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