Eradicate remaining usages of public Position->world field

and as an added bonus, ditch a bunch of extra phpstan errors
This commit is contained in:
Dylan K. Taylor
2020-05-19 19:14:56 +01:00
parent 8a8b1b0b97
commit 337addf1de
4 changed files with 4 additions and 84 deletions

View File

@ -47,9 +47,9 @@ trait FallableTrait{
public function onNearbyBlockChange() : void{
$pos = $this->getPos();
$down = $pos->world->getBlock($pos->getSide(Facing::DOWN));
$down = $pos->getWorldNonNull()->getBlock($pos->getSide(Facing::DOWN));
if($down->getId() === BlockLegacyIds::AIR or $down instanceof Liquid or $down instanceof Fire){
$pos->world->setBlock($pos, VanillaBlocks::AIR());
$pos->getWorldNonNull()->setBlock($pos, VanillaBlocks::AIR());
$nbt = EntityFactory::createBaseNBT($pos->add(0.5, 0, 0.5));
$nbt->setInt("TileID", $this->getId());