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:
SalmonDE
2021-08-23 15:01:32 +02:00
committed by GitHub
parent 22316976fa
commit 7fd712c1ff
93 changed files with 402 additions and 402 deletions

View File

@ -121,7 +121,7 @@ class Door extends Transparent{
public function onNearbyBlockChange() : void{
if($this->getSide(Facing::DOWN)->getId() === BlockLegacyIds::AIR){ //Replace with common break method
$this->pos->getWorld()->useBreakOn($this->pos); //this will delete both halves if they exist
$this->position->getWorld()->useBreakOn($this->position); //this will delete both halves if they exist
}
}
@ -147,7 +147,7 @@ class Door extends Transparent{
$topHalf = clone $this;
$topHalf->top = true;
$tx->addBlock($blockReplace->pos, $this)->addBlock($blockUp->pos, $topHalf);
$tx->addBlock($blockReplace->position, $this)->addBlock($blockUp->position, $topHalf);
return true;
}
@ -160,11 +160,11 @@ class Door extends Transparent{
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
if($other instanceof Door and $other->isSameType($this)){
$other->open = $this->open;
$this->pos->getWorld()->setBlock($other->pos, $other);
$this->position->getWorld()->setBlock($other->position, $other);
}
$this->pos->getWorld()->setBlock($this->pos, $this);
$this->pos->getWorld()->addSound($this->pos, new DoorSound());
$this->position->getWorld()->setBlock($this->position, $this);
$this->position->getWorld()->addSound($this->position, new DoorSound());
return true;
}