Clean up terminology around block state IDs and their handling

This commit is contained in:
Dylan K. Taylor
2023-01-25 18:53:11 +00:00
parent 2f469ef4a0
commit 0a3ecfdae9
30 changed files with 81 additions and 78 deletions

View File

@ -29,16 +29,16 @@ class ChunkTest extends TestCase{
public function testClone() : void{
$chunk = new Chunk([], false);
$chunk->setFullBlock(0, 0, 0, 1);
$chunk->setBlockStateId(0, 0, 0, 1);
$chunk->setBiomeId(0, 0, 0, 1);
$chunk->setHeightMap(0, 0, 1);
$chunk2 = clone $chunk;
$chunk2->setFullBlock(0, 0, 0, 2);
$chunk2->setBlockStateId(0, 0, 0, 2);
$chunk2->setBiomeId(0, 0, 0, 2);
$chunk2->setHeightMap(0, 0, 2);
self::assertNotSame($chunk->getFullBlock(0, 0, 0), $chunk2->getFullBlock(0, 0, 0));
self::assertNotSame($chunk->getBlockStateId(0, 0, 0), $chunk2->getBlockStateId(0, 0, 0));
self::assertNotSame($chunk->getBiomeId(0, 0, 0), $chunk2->getBiomeId(0, 0, 0));
self::assertNotSame($chunk->getHeightMap(0, 0), $chunk2->getHeightMap(0, 0));
}

View File

@ -34,17 +34,17 @@ class SubChunkTest extends TestCase{
public function testClone() : void{
$sub1 = new SubChunk(0, [], new PalettedBlockArray(BiomeIds::OCEAN));
$sub1->setFullBlock(0, 0, 0, 1);
$sub1->setBlockStateId(0, 0, 0, 1);
$sub1->getBlockLightArray()->set(0, 0, 0, 1);
$sub1->getBlockSkyLightArray()->set(0, 0, 0, 1);
$sub2 = clone $sub1;
$sub2->setFullBlock(0, 0, 0, 2);
$sub2->setBlockStateId(0, 0, 0, 2);
$sub2->getBlockLightArray()->set(0, 0, 0, 2);
$sub2->getBlockSkyLightArray()->set(0, 0, 0, 2);
self::assertNotSame($sub1->getFullBlock(0, 0, 0), $sub2->getFullBlock(0, 0, 0));
self::assertNotSame($sub1->getBlockStateId(0, 0, 0), $sub2->getBlockStateId(0, 0, 0));
self::assertNotSame($sub1->getBlockLightArray()->get(0, 0, 0), $sub2->getBlockLightArray()->get(0, 0, 0));
self::assertNotSame($sub1->getBlockSkyLightArray()->get(0, 0, 0), $sub2->getBlockSkyLightArray()->get(0, 0, 0));
}