diff --git a/anvil-loader/src/test/java/mc/world/anvil/RegionTest.java b/anvil-loader/src/test/java/mc/world/anvil/RegionTest.java index 03963b9..81b5d2a 100644 --- a/anvil-loader/src/test/java/mc/world/anvil/RegionTest.java +++ b/anvil-loader/src/test/java/mc/world/anvil/RegionTest.java @@ -63,7 +63,8 @@ class RegionTest { void getChunkSection() { final Chunk chunk = region.getChunk(0, 0); assertNotNull(chunk); - final ChunkSection chunkSection = chunk.getChunkSection(0); + + ChunkSection chunkSection = chunk.getChunkSection(0); assertNotNull(chunkSection); 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)); + } + } + } + } } } diff --git a/anvil-loader/src/test/resources/region/r.0.0.mca b/anvil-loader/src/test/resources/region/r.0.0.mca index 5bd265e..25605df 100644 Binary files a/anvil-loader/src/test/resources/region/r.0.0.mca and b/anvil-loader/src/test/resources/region/r.0.0.mca differ