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

@ -49,14 +49,14 @@ trait FallableTrait{
public function onNearbyBlockChange() : void{
$pos = $this->getPos();
$down = $pos->getWorldNonNull()->getBlock($pos->getSide(Facing::DOWN));
$down = $pos->getWorld()->getBlock($pos->getSide(Facing::DOWN));
if($down->getId() === BlockLegacyIds::AIR or $down instanceof Liquid or $down instanceof Fire){
$pos->getWorldNonNull()->setBlock($pos, VanillaBlocks::AIR());
$pos->getWorld()->setBlock($pos, VanillaBlocks::AIR());
$block = $this;
if(!($block instanceof Block)) throw new AssumptionFailedError(__TRAIT__ . " should only be used by Blocks");
$fall = new FallingBlock(Location::fromObject($pos->add(0.5, 0, 0.5), $pos->getWorldNonNull()), $block);
$fall = new FallingBlock(Location::fromObject($pos->add(0.5, 0, 0.5), $pos->getWorld()), $block);
$fall->spawnToAll();
}
}