mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Refactor Block & Tile: getPos() to getPosition() (#4395)
this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
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->position->getWorld()->getTile($this->position);
|
||||
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->position->getWorld()->getTile($this->position);
|
||||
assert($tile instanceof Comparator);
|
||||
$tile->setSignalStrength($this->signalStrength);
|
||||
}
|
||||
@ -115,13 +115,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->position->getWorld()->setBlock($this->position, $this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if($this->getSide(Facing::DOWN)->isTransparent()){
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
$this->position->getWorld()->useBreakOn($this->position);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user