mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3'
This commit is contained in:
@ -63,7 +63,7 @@ class DragonEgg extends Transparent implements Fallable{
|
||||
|
||||
public function teleport() : void{
|
||||
for($tries = 0; $tries < 16; ++$tries){
|
||||
$block = $this->pos->getWorld()->getBlockAt(
|
||||
$block = $this->pos->getWorldNonNull()->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->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);
|
||||
$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);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user