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

@ -359,7 +359,7 @@ class InGamePacketHandler extends PacketHandler{
}else{
$blocks[] = $blockPos;
}
$this->player->getLocation()->getWorldNonNull()->sendBlocks([$this->player], $blocks);
$this->player->getLocation()->getWorld()->sendBlocks([$this->player], $blocks);
}
}
@ -563,7 +563,7 @@ class InGamePacketHandler extends PacketHandler{
return false;
}
$block = $this->player->getLocation()->getWorldNonNull()->getBlock($pos);
$block = $this->player->getLocation()->getWorld()->getBlock($pos);
$nbt = $packet->namedtag->getRoot();
if(!($nbt instanceof CompoundTag)) throw new AssumptionFailedError("PHPStan should ensure this is a CompoundTag"); //for phpstorm's benefit

View File

@ -68,12 +68,12 @@ class PreSpawnPacketHandler extends PacketHandler{
$pk->seed = -1;
$pk->spawnSettings = new SpawnSettings(SpawnSettings::BIOME_TYPE_DEFAULT, "", DimensionIds::OVERWORLD); //TODO: implement this properly
$pk->worldGamemode = TypeConverter::getInstance()->coreGameModeToProtocol($this->server->getGamemode());
$pk->difficulty = $location->getWorldNonNull()->getDifficulty();
$pk->difficulty = $location->getWorld()->getDifficulty();
$pk->spawnX = $spawnPosition->getFloorX();
$pk->spawnY = $spawnPosition->getFloorY();
$pk->spawnZ = $spawnPosition->getFloorZ();
$pk->hasAchievementsDisabled = true;
$pk->time = $location->getWorldNonNull()->getTime();
$pk->time = $location->getWorld()->getTime();
$pk->eduEditionOffer = 0;
$pk->rainLevel = 0; //TODO: implement these properly
$pk->lightningLevel = 0;