mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
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:
@ -58,13 +58,13 @@ class SubChunkExplorer{
|
||||
/**
|
||||
* @phpstan-return SubChunkExplorerStatus::*
|
||||
*/
|
||||
public function moveTo(int $x, int $y, int $z, bool $create) : int{
|
||||
public function moveTo(int $x, int $y, int $z) : int{
|
||||
if($this->currentChunk === null or $this->currentX !== ($x >> 4) or $this->currentZ !== ($z >> 4)){
|
||||
$this->currentX = $x >> 4;
|
||||
$this->currentZ = $z >> 4;
|
||||
$this->currentSubChunk = null;
|
||||
|
||||
$this->currentChunk = $this->world->getChunk($this->currentX, $this->currentZ, $create);
|
||||
$this->currentChunk = $this->world->getChunk($this->currentX, $this->currentZ);
|
||||
if($this->currentChunk === null){
|
||||
return SubChunkExplorerStatus::INVALID;
|
||||
}
|
||||
@ -93,9 +93,9 @@ class SubChunkExplorer{
|
||||
/**
|
||||
* @phpstan-return SubChunkExplorerStatus::*
|
||||
*/
|
||||
public function moveToChunk(int $chunkX, int $chunkY, int $chunkZ, bool $create) : int{
|
||||
public function moveToChunk(int $chunkX, int $chunkY, int $chunkZ) : int{
|
||||
//this is a cold path, so we don't care much if it's a bit slower (extra fcall overhead)
|
||||
return $this->moveTo($chunkX << 4, $chunkY << 4, $chunkZ << 4, $create);
|
||||
return $this->moveTo($chunkX << 4, $chunkY << 4, $chunkZ << 4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user