mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user