Chunk: Drop dirty flags for tiles and entities

instead, just ungate this and allow the provider to decide what to do.
Any chunk that contains entities or tiles is already always considered dirty, so the only thing the flags are good for is flagging chunks that previously had tiles and/or entities but no longer do.
In those cases, it's just removing keys from LevelDB anyway, so it's already very cheap.
Avoiding these redundant deletions is not worth the extra complexity and fragility of relying on flags to track this stuff.
This commit is contained in:
Dylan K. Taylor
2021-08-30 00:09:36 +01:00
parent 4b06e19d28
commit 0289b45202
6 changed files with 37 additions and 52 deletions

View File

@ -146,7 +146,7 @@ final class FastChunkSerializer{
$chunk = new Chunk($subChunks, $biomeIds, $heightMap);
$chunk->setPopulated($terrainPopulated);
$chunk->setLightPopulated($lightPopulated);
$chunk->clearDirtyFlags();
$chunk->clearTerrainDirtyFlags();
return $chunk;
}