mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
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:
@ -44,7 +44,7 @@ class Chunk{
|
||||
public const COORD_BIT_SIZE = SubChunk::COORD_BIT_SIZE;
|
||||
public const COORD_MASK = SubChunk::COORD_MASK;
|
||||
|
||||
private int $terrainDirtyFlags = 0;
|
||||
private int $terrainDirtyFlags = ~0;
|
||||
|
||||
protected ?bool $lightPopulated = false;
|
||||
protected bool $terrainPopulated = false;
|
||||
|
@ -695,18 +695,8 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
|
||||
|
||||
//TODO: tile ticks, biome states (?)
|
||||
|
||||
$chunk = new Chunk(
|
||||
$subChunks,
|
||||
$terrainPopulated
|
||||
);
|
||||
|
||||
if($hasBeenUpgraded){
|
||||
$logger->debug("Flagging chunk as dirty due to upgraded data");
|
||||
$chunk->setTerrainDirty(); //trigger rewriting chunk to disk if it was converted from an older format
|
||||
}
|
||||
|
||||
return new LoadedChunkData(
|
||||
data: new ChunkData($chunk, $entities, $tiles),
|
||||
data: new ChunkData(new Chunk($subChunks, $terrainPopulated), $entities, $tiles),
|
||||
upgraded: $hasBeenUpgraded,
|
||||
fixerFlags: LoadedChunkData::FIXER_FLAG_ALL //TODO: fill this by version rather than just setting all flags
|
||||
);
|
||||
|
Reference in New Issue
Block a user