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:
@ -91,7 +91,7 @@ class Leaves extends Transparent{
|
||||
}
|
||||
$visited[$index] = true;
|
||||
|
||||
$block = $this->pos->getWorld()->getBlock($pos);
|
||||
$block = $this->position->getWorld()->getBlock($pos);
|
||||
if($block instanceof Wood){ //type doesn't matter
|
||||
return true;
|
||||
}
|
||||
@ -110,7 +110,7 @@ class Leaves extends Transparent{
|
||||
public function onNearbyBlockChange() : void{
|
||||
if(!$this->noDecay and !$this->checkDecay){
|
||||
$this->checkDecay = true;
|
||||
$this->pos->getWorld()->setBlock($this->pos, $this, false);
|
||||
$this->position->getWorld()->setBlock($this->position, $this, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,11 +122,11 @@ class Leaves extends Transparent{
|
||||
if(!$this->noDecay and $this->checkDecay){
|
||||
$ev = new LeavesDecayEvent($this);
|
||||
$ev->call();
|
||||
if($ev->isCancelled() or $this->findLog($this->pos)){
|
||||
if($ev->isCancelled() or $this->findLog($this->position)){
|
||||
$this->checkDecay = false;
|
||||
$this->pos->getWorld()->setBlock($this->pos, $this, false);
|
||||
$this->position->getWorld()->setBlock($this->position, $this, false);
|
||||
}else{
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
$this->position->getWorld()->useBreakOn($this->position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user