2022-03-10 22:43:47 +01:00
|
|
|
package net.minestom.server.snapshot;
|
|
|
|
|
2022-10-10 20:44:50 +02:00
|
|
|
import net.minestom.testing.Env;
|
|
|
|
import net.minestom.testing.EnvTest;
|
2022-03-10 22:43:47 +01:00
|
|
|
import net.minestom.server.instance.block.Block;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
|
|
|
|
@EnvTest
|
|
|
|
public class ChunkSnapshotIntegrationTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void blocks(Env env) {
|
|
|
|
var instance = env.createFlatInstance();
|
|
|
|
instance.setBlock(0, 0, 0, Block.STONE);
|
|
|
|
var snapshot = ServerSnapshot.update();
|
|
|
|
|
|
|
|
var inst = snapshot.instances().iterator().next();
|
|
|
|
assertEquals(Block.STONE, inst.getBlock(0, 0, 0));
|
|
|
|
|
|
|
|
assertEquals(1, inst.chunks().size());
|
|
|
|
var chunk = inst.chunks().iterator().next();
|
|
|
|
assertEquals(Block.STONE, chunk.getBlock(0, 0, 0));
|
|
|
|
}
|
|
|
|
}
|