Position: rename getWorldNonNull() to getWorld(), remove original getWorld()

This commit is contained in:
Dylan K. Taylor
2020-06-29 21:19:46 +01:00
parent fc22fd80d8
commit 670ad9eb9d
81 changed files with 259 additions and 275 deletions

View File

@ -63,7 +63,7 @@ class DragonEgg extends Transparent implements Fallable{
public function teleport() : void{
for($tries = 0; $tries < 16; ++$tries){
$block = $this->pos->getWorldNonNull()->getBlockAt(
$block = $this->pos->getWorld()->getBlockAt(
$this->pos->x + mt_rand(-16, 16),
max(0, min(World::Y_MAX - 1, $this->pos->y + mt_rand(-8, 8))),
$this->pos->z + mt_rand(-16, 16)
@ -76,9 +76,9 @@ class DragonEgg extends Transparent implements Fallable{
}
$blockPos = $ev->getTo();
$this->pos->getWorldNonNull()->addParticle($this->pos, new DragonEggTeleportParticle($this->pos->x - $blockPos->x, $this->pos->y - $blockPos->y, $this->pos->z - $blockPos->z));
$this->pos->getWorldNonNull()->setBlock($this->pos, VanillaBlocks::AIR());
$this->pos->getWorldNonNull()->setBlock($blockPos, $this);
$this->pos->getWorld()->addParticle($this->pos, new DragonEggTeleportParticle($this->pos->x - $blockPos->x, $this->pos->y - $blockPos->y, $this->pos->z - $blockPos->z));
$this->pos->getWorld()->setBlock($this->pos, VanillaBlocks::AIR());
$this->pos->getWorld()->setBlock($blockPos, $this);
break;
}
}