Skip to content

Commit

Permalink
fix: fix test due to leveldb changes
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Dec 3, 2024
1 parent 6cb44b2 commit 4db5fb5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.allaymc.api.world.World;
import org.allaymc.api.world.biome.BiomeId;
import org.allaymc.api.world.chunk.Chunk;
import org.allaymc.api.world.chunk.ChunkState;
import org.allaymc.server.world.AllayWorldData;
import org.allaymc.server.world.chunk.AllayChunk;
import org.allaymc.server.world.chunk.AllayUnsafeChunk;
Expand Down Expand Up @@ -91,6 +92,8 @@ void testWriteAllayWorldData() {
@Order(3)
void testSaveChunk() {
AllayUnsafeChunk allayUnsafeChunk = AllayUnsafeChunk.builder().emptyChunk(0, 0, DimensionInfo.OVERWORLD);
// So that the chunk can be written
allayUnsafeChunk.setState(ChunkState.FINISHED);
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
for (int k = -64; k < 320; k++) {
Expand All @@ -101,14 +104,14 @@ void testSaveChunk() {
}
}
AllayChunk allayChunk = new AllayChunk(allayUnsafeChunk);
levelDBWorldStorage.writeChunk(allayChunk).join();
levelDBWorldStorage.writeChunkSync(allayChunk);
}

@SneakyThrows
@Test
@Order(4)
void testReadChunk() {
Chunk chunk = levelDBWorldStorage.readChunk(0, 0, DimensionInfo.OVERWORLD).join();
Chunk chunk = levelDBWorldStorage.readChunkSync(0, 0, DimensionInfo.OVERWORLD);
Assertions.assertEquals(OAK_WOOD.getDefaultState(), chunk.getBlockState(0, 55, 0));
Assertions.assertEquals(BiomeId.FOREST, chunk.getBiome(0, 55, 0));
Assertions.assertEquals(319, chunk.getHeight(0, 0));
Expand Down

0 comments on commit 4db5fb5

Please sign in to comment.