mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Eliminate repeated calls to Position->getWorld()
as well as improving readability, it also improves performance in some areas.
This commit is contained in:
@ -60,15 +60,16 @@ class PreSpawnPacketHandler extends PacketHandler{
|
||||
|
||||
public function setUp() : void{
|
||||
$location = $this->player->getLocation();
|
||||
$world = $location->getWorld();
|
||||
|
||||
$levelSettings = new LevelSettings();
|
||||
$levelSettings->seed = -1;
|
||||
$levelSettings->spawnSettings = new SpawnSettings(SpawnSettings::BIOME_TYPE_DEFAULT, "", DimensionIds::OVERWORLD); //TODO: implement this properly
|
||||
$levelSettings->worldGamemode = TypeConverter::getInstance()->coreGameModeToProtocol($this->server->getGamemode());
|
||||
$levelSettings->difficulty = $location->getWorld()->getDifficulty();
|
||||
$levelSettings->spawnPosition = BlockPosition::fromVector3($location->getWorld()->getSpawnLocation());
|
||||
$levelSettings->difficulty = $world->getDifficulty();
|
||||
$levelSettings->spawnPosition = BlockPosition::fromVector3($world->getSpawnLocation());
|
||||
$levelSettings->hasAchievementsDisabled = true;
|
||||
$levelSettings->time = $location->getWorld()->getTime();
|
||||
$levelSettings->time = $world->getTime();
|
||||
$levelSettings->eduEditionOffer = 0;
|
||||
$levelSettings->rainLevel = 0; //TODO: implement these properly
|
||||
$levelSettings->lightningLevel = 0;
|
||||
|
Reference in New Issue
Block a user