mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3'
This commit is contained in:
@ -72,7 +72,7 @@ class RedstoneComparator extends Flowable{
|
||||
|
||||
public function readStateFromWorld() : void{
|
||||
parent::readStateFromWorld();
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
$tile = $this->pos->getWorldNonNull()->getTile($this->pos);
|
||||
if($tile instanceof Comparator){
|
||||
$this->signalStrength = $tile->getSignalStrength();
|
||||
}
|
||||
@ -80,7 +80,7 @@ class RedstoneComparator extends Flowable{
|
||||
|
||||
public function writeStateToWorld() : void{
|
||||
parent::writeStateToWorld();
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
$tile = $this->pos->getWorldNonNull()->getTile($this->pos);
|
||||
assert($tile instanceof Comparator);
|
||||
$tile->setSignalStrength($this->signalStrength);
|
||||
}
|
||||
@ -143,13 +143,13 @@ class RedstoneComparator extends Flowable{
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
$this->isSubtractMode = !$this->isSubtractMode;
|
||||
$this->pos->getWorld()->setBlock($this->pos, $this);
|
||||
$this->pos->getWorldNonNull()->setBlock($this->pos, $this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if($this->getSide(Facing::DOWN)->isTransparent()){
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
$this->pos->getWorldNonNull()->useBreakOn($this->pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user