force load all chunks on load, check is entity correct or not

This commit is contained in:
GameHerobrine 2024-02-15 02:55:02 +03:00
parent cfabae7583
commit 869b8b111a
3 changed files with 77 additions and 1 deletions

View file

@ -40,6 +40,12 @@ class LevelAPI{
console("[ERROR] Could not load level \"" . $name . "\"");
return false;
}
for($X = 0; $X < 16; ++$X){
for($Z = 0; $Z < 16; ++$Z){
$level->loadChunk($X, $Z);
}
}
$entities = new Config($path . "entities.yml", CONFIG_YAML);
if(file_exists($path . "tileEntities.yml")){
@rename($path . "tileEntities.yml", $path . "tiles.yml");
@ -94,6 +100,7 @@ class LevelAPI{
foreach($blockUpdates->getAll() as $bupdate){
if($bupdate["type"] !== BLOCK_UPDATE_RANDOM) $this->server->api->block->scheduleBlockUpdate(new Position((int) $bupdate["x"], (int) $bupdate["y"], (int) $bupdate["z"], $this->levels[$name]), (float) $bupdate["delay"], (int) $bupdate["type"]);
}
return true;
}
/**