Archived
0

обновление теста anvil chunk

проверяем следующий фрагмент чанка
This commit is contained in:
2018-10-27 16:36:17 +03:00
parent 513ad30f81
commit ab6501fbfd
2 changed files with 26 additions and 1 deletions

View File

@@ -63,7 +63,8 @@ class RegionTest {
void getChunkSection() { void getChunkSection() {
final Chunk chunk = region.getChunk(0, 0); final Chunk chunk = region.getChunk(0, 0);
assertNotNull(chunk); assertNotNull(chunk);
final ChunkSection chunkSection = chunk.getChunkSection(0);
ChunkSection chunkSection = chunk.getChunkSection(0);
assertNotNull(chunkSection); assertNotNull(chunkSection);
for (int y = 0; y < 16; y++) { for (int y = 0; y < 16; y++) {
@@ -88,5 +89,29 @@ class RegionTest {
} }
} }
} }
chunkSection = chunk.getChunkSection(1);
assertNotNull(chunkSection);
for (int y = 0; y < 16; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
Block block = chunkSection.getBlock(x, y, z);
if (x == 0 && z == 0) {
assertEquals(BlockType.STONE, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
} else if (x == 15 && z == 0) {
assertEquals(BlockType.GRANITE, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
} else if (x == 15 && z == 15) {
assertEquals(BlockType.DIORITE, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
} else if (x == 0 && z == 15) {
assertEquals(BlockType.ANDESITE, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
} else if (x == 0 || x == 15 || z == 0 || z == 15) {
assertEquals(BlockType.DIAMOND_ORE, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
} else {
assertEquals(BlockType.AIR, block.getBlockType(), String.format("coords: %d %d %d", x, y, z));
}
}
}
}
} }
} }