Assume chunks are dirty by default

having them be clean by default makes no sense. It only makes sense for them to be clean if they were loaded directly from disk without any alterations.

Default clean is a footgun.
This commit is contained in:
Dylan K. Taylor
2023-05-29 17:22:39 +01:00
parent c10be0f346
commit ce5e663a73
4 changed files with 9 additions and 15 deletions

View File

@ -2717,7 +2717,13 @@ class World implements ChunkManager{
return null;
}
$this->chunks[$chunkHash] = $loadedChunkData->getData()->getChunk();
$chunk = $loadedChunkData->getData()->getChunk();
if(!$loadedChunkData->isUpgraded()){
$chunk->clearTerrainDirtyFlags();
}else{
$this->logger->debug("Chunk $x $z has been upgraded, will be saved at the next autosave opportunity");
}
$this->chunks[$chunkHash] = $chunk;
unset($this->blockCache[$chunkHash]);
$this->initChunk($x, $z, $loadedChunkData->getData());