mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Limit SubChunk to 2 layers, avoid arrays (#6747)
Initially proposed in #6575 This shows about a 10% performance improvement to both SubChunk->getBlockStateId() and SubChunk->setBlockStateId(), so definitely worth doing. It does result in increased complexity, but for a double digits performance gain, I think it's worth it. Closes #6575
This commit is contained in:
@@ -32,7 +32,7 @@ class SubChunkTest extends TestCase{
|
||||
* Test that a cloned SubChunk instance doesn't influence the original
|
||||
*/
|
||||
public function testClone() : void{
|
||||
$sub1 = new SubChunk(0, [], new PalettedBlockArray(BiomeIds::OCEAN));
|
||||
$sub1 = new SubChunk(0, null, null, new PalettedBlockArray(BiomeIds::OCEAN));
|
||||
|
||||
$sub1->setBlockStateId(0, 0, 0, 1);
|
||||
$sub1->getBlockLightArray()->set(0, 0, 0, 1);
|
||||
|
Reference in New Issue
Block a user