mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Chunk: Share EmptySubChunk instance with other chunks on the same thread
This commit is contained in:
@ -103,7 +103,7 @@ class Chunk{
|
||||
$this->height = Chunk::MAX_SUBCHUNKS; //TODO: add a way of changing this
|
||||
|
||||
$this->subChunks = new \SplFixedArray($this->height);
|
||||
$this->emptySubChunk = new EmptySubChunk();
|
||||
$this->emptySubChunk = EmptySubChunk::getInstance();
|
||||
|
||||
foreach($this->subChunks as $y => $null){
|
||||
$this->subChunks[$y] = $subChunks[$y] ?? $this->emptySubChunk;
|
||||
|
Reference in New Issue
Block a user