Remove $create parameter from ChunkManager::getChunk()

this restores SimpleChunkManager's behaviour to PM3, removing the need for GeneratorChunkManager (although I'm dubious whether SubChunkExplorer makes any sense in there any more now that we have morton in the mix).
This commit is contained in:
Dylan K. Taylor
2020-10-31 21:54:51 +00:00
parent dec235abab
commit ddda2d1e64
11 changed files with 27 additions and 68 deletions

View File

@ -61,7 +61,7 @@ class SkyLightUpdate extends LightUpdate{
}
public function recalculateNode(int $x, int $y, int $z) : void{
if($this->subChunkExplorer->moveTo($x, $y, $z, false) === SubChunkExplorerStatus::INVALID){
if($this->subChunkExplorer->moveTo($x, $y, $z) === SubChunkExplorerStatus::INVALID){
return;
}
$chunk = $this->subChunkExplorer->currentChunk;
@ -98,7 +98,7 @@ class SkyLightUpdate extends LightUpdate{
}
public function recalculateChunk(int $chunkX, int $chunkZ) : int{
if($this->subChunkExplorer->moveToChunk($chunkX, 0, $chunkZ, false) === SubChunkExplorerStatus::INVALID){
if($this->subChunkExplorer->moveToChunk($chunkX, 0, $chunkZ) === SubChunkExplorerStatus::INVALID){
throw new \InvalidArgumentException("Chunk $chunkX $chunkZ does not exist");
}
$chunk = $this->subChunkExplorer->currentChunk;
@ -151,7 +151,7 @@ class SkyLightUpdate extends LightUpdate{
$lightSources++;
}
for($y = $nodeColumnEnd + 1, $yMax = $lowestClearSubChunk * 16; $y < $yMax; $y++){
if($this->subChunkExplorer->moveTo($x + $baseX, $y, $z + $baseZ, false) !== SubChunkExplorerStatus::INVALID){
if($this->subChunkExplorer->moveTo($x + $baseX, $y, $z + $baseZ) !== SubChunkExplorerStatus::INVALID){
$this->getCurrentLightArray()->set($x, $y & 0xf, $z, 15);
}
}