mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +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:
@ -54,10 +54,10 @@ abstract class BaseCoral extends Transparent{
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if(!$this->dead){
|
||||
$world = $this->pos->getWorld();
|
||||
$world = $this->position->getWorld();
|
||||
|
||||
$hasWater = false;
|
||||
foreach($this->pos->sides() as $vector3){
|
||||
foreach($this->position->sides() as $vector3){
|
||||
if($world->getBlock($vector3) instanceof Water){
|
||||
$hasWater = true;
|
||||
break;
|
||||
@ -66,7 +66,7 @@ abstract class BaseCoral extends Transparent{
|
||||
|
||||
//TODO: check water inside the block itself (not supported on the API yet)
|
||||
if(!$hasWater){
|
||||
$world->setBlock($this->pos, $this->setDead(true));
|
||||
$world->setBlock($this->position, $this->setDead(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user