WorldProvider subsystem no longer depends on Chunk

Instead, it provides the data needed to construct the chunk, which doesn't require the provider to be aware of anywhere near as much logic.
This commit is contained in:
Dylan K. Taylor
2023-05-29 17:44:00 +01:00
parent d57954dff0
commit a49842278a
8 changed files with 39 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\world\format\io;
use pocketmine\utils\Filesystem;
use pocketmine\world\format\Chunk;
use pocketmine\world\generator\GeneratorManager;
use pocketmine\world\generator\normal\Normal;
use pocketmine\world\WorldCreationOptions;
@@ -142,9 +143,7 @@ class FormatConverter{
$thisRound = $start;
foreach($this->oldProvider->getAllChunks(true, $this->logger) as $coords => $loadedChunkData){
[$chunkX, $chunkZ] = $coords;
$chunkData = $loadedChunkData->getData();
$chunkData->getChunk()->setTerrainDirty();
$new->saveChunk($chunkX, $chunkZ, $chunkData);
$new->saveChunk($chunkX, $chunkZ, $loadedChunkData->getData(), ~0);
$counter++;
if(($counter % $this->chunksPerProgressUpdate) === 0){
$time = microtime(true);