mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Chunk: rename DIRTY_FLAG_TERRAIN to DIRTY_FLAG_BLOCKS
we use the word 'terrain' elsewhere to refer to the combination of blocks and biomes, so using TERRAIN here is misleading.
This commit is contained in:
parent
a62ce64fdd
commit
d410db4302
@ -32,7 +32,7 @@ use pocketmine\block\tile\Tile;
|
||||
use function array_map;
|
||||
|
||||
class Chunk{
|
||||
public const DIRTY_FLAG_TERRAIN = 1 << 0;
|
||||
public const DIRTY_FLAG_BLOCKS = 1 << 0;
|
||||
public const DIRTY_FLAG_BIOMES = 1 << 3;
|
||||
|
||||
public const MAX_SUBCHUNKS = 16;
|
||||
@ -106,7 +106,7 @@ class Chunk{
|
||||
*/
|
||||
public function setFullBlock(int $x, int $y, int $z, int $block) : void{
|
||||
$this->getSubChunk($y >> SubChunk::COORD_BIT_SIZE)->setFullBlock($x, $y & SubChunk::COORD_MASK, $z, $block);
|
||||
$this->terrainDirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
$this->terrainDirtyFlags |= self::DIRTY_FLAG_BLOCKS;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,7 +186,7 @@ class Chunk{
|
||||
|
||||
public function setPopulated(bool $value = true) : void{
|
||||
$this->terrainPopulated = $value;
|
||||
$this->terrainDirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
$this->terrainDirtyFlags |= self::DIRTY_FLAG_BLOCKS;
|
||||
}
|
||||
|
||||
public function addTile(Tile $tile) : void{
|
||||
@ -295,7 +295,7 @@ class Chunk{
|
||||
}
|
||||
|
||||
$this->subChunks[$y] = $subChunk ?? new SubChunk(BlockLegacyIds::AIR << Block::INTERNAL_METADATA_BITS, []);
|
||||
$this->setTerrainDirtyFlag(self::DIRTY_FLAG_TERRAIN, true);
|
||||
$this->setTerrainDirtyFlag(self::DIRTY_FLAG_BLOCKS, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -436,7 +436,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
|
||||
$write->put($index . self::TAG_VERSION, chr(self::CURRENT_LEVEL_CHUNK_VERSION));
|
||||
|
||||
$chunk = $chunkData->getChunk();
|
||||
if($chunk->getTerrainDirtyFlag(Chunk::DIRTY_FLAG_TERRAIN)){
|
||||
if($chunk->getTerrainDirtyFlag(Chunk::DIRTY_FLAG_BLOCKS)){
|
||||
$subChunks = $chunk->getSubChunks();
|
||||
foreach($subChunks as $y => $subChunk){
|
||||
$key = $index . self::TAG_SUBCHUNK_PREFIX . chr($y);
|
||||
|
@ -117,7 +117,7 @@ class PopulationTask extends AsyncTask{
|
||||
if($chunk === null){
|
||||
throw new AssumptionFailedError("We just set this chunk, so it must exist");
|
||||
}
|
||||
$chunk->setTerrainDirtyFlag(Chunk::DIRTY_FLAG_TERRAIN, true);
|
||||
$chunk->setTerrainDirtyFlag(Chunk::DIRTY_FLAG_BLOCKS, true);
|
||||
$chunk->setTerrainDirtyFlag(Chunk::DIRTY_FLAG_BIOMES, true);
|
||||
}
|
||||
return $chunk;
|
||||
|
Loading…
x
Reference in New Issue
Block a user