use of org.terasology.engine.world.internal.ChunkViewCore in project Terasology by MovingBlocks.
the class ChunkViewTest method testSimpleWorldView.
@Test
public void testSimpleWorldView() {
Chunk chunk = createChunk(0, 0, 0);
chunk.setBlock(new Vector3i(0, 0, 0), solidBlock);
ChunkViewCore chunkView = new ChunkViewCoreImpl(new Chunk[] { chunk }, new BlockRegion(0, 0, 0), new Vector3i(), airBlock);
assertEquals(solidBlock, chunkView.getBlock(0, 0, 0));
}
use of org.terasology.engine.world.internal.ChunkViewCore in project Terasology by MovingBlocks.
the class ChunkViewTest method testOffsetChunksWorldView.
@Test
public void testOffsetChunksWorldView() {
Chunk chunk = createChunk(1, 0, 1);
chunk.setBlock(new Vector3i(0, 0, 0), solidBlock);
Chunk[] chunks = new Chunk[] { createChunk(0, 0, 0), createChunk(1, 0, 0), createChunk(2, 0, 0), createChunk(0, 0, 1), chunk, createChunk(2, 0, 1), createChunk(0, 0, 2), createChunk(1, 0, 2), createChunk(2, 0, 2) };
ChunkViewCore chunkView = new ChunkViewCoreImpl(chunks, new BlockRegion(1, 0, 1).expand(1, 0, 1), new Vector3i(1, 0, 1), airBlock);
assertEquals(solidBlock, chunkView.getBlock(0, 0, 0));
}
use of org.terasology.engine.world.internal.ChunkViewCore in project Terasology by MovingBlocks.
the class ChunkViewTest method testOffsetWorldViewAfterMainChunk.
@Test
public void testOffsetWorldViewAfterMainChunk() {
Chunk chunk = createChunk(0, 0, 0);
chunk.setBlock(new Vector3i(0, 0, 0), solidBlock);
Chunk[] chunks = new Chunk[] { createChunk(-1, 0, -1), createChunk(0, 0, -1), createChunk(1, 0, -1), createChunk(-1, 0, 0), createChunk(0, 0, 0), createChunk(1, 0, 0), createChunk(-1, 0, 1), createChunk(0, 0, 1), chunk };
ChunkViewCore chunkView = new ChunkViewCoreImpl(chunks, new BlockRegion(0, 0, 0).expand(1, 0, 1), new Vector3i(1, 0, 1), airBlock);
assertEquals(solidBlock, chunkView.getBlock(Chunks.SIZE_X, 0, Chunks.SIZE_Z));
}
use of org.terasology.engine.world.internal.ChunkViewCore in project Terasology by MovingBlocks.
the class ChunkViewTest method testOffsetWorldViewBeforeMainChunk.
@Test
public void testOffsetWorldViewBeforeMainChunk() {
Chunk chunk = createChunk(0, 0, 0);
chunk.setBlock(new Vector3i(Chunks.SIZE_X - 1, 0, Chunks.SIZE_Z - 1), solidBlock);
Chunk[] chunks = new Chunk[] { chunk, createChunk(0, 0, -1), createChunk(1, 0, -1), createChunk(-1, 0, 0), createChunk(0, 0, 0), createChunk(1, 0, 0), createChunk(-1, 0, 1), createChunk(0, 0, 1), createChunk(1, 0, 1) };
ChunkViewCore chunkView = new ChunkViewCoreImpl(chunks, new BlockRegion(0, 0, 0).expand(1, 0, 1), new Vector3i(1, 0, 1), airBlock);
assertEquals(solidBlock, chunkView.getBlock(-1, 0, -1));
}
use of org.terasology.engine.world.internal.ChunkViewCore in project Terasology by MovingBlocks.
the class ChunkViewTest method testOffsetWorldView.
@Test
public void testOffsetWorldView() {
Chunk chunk = createChunk(0, 0, 0);
chunk.setBlock(new Vector3i(0, 0, 0), solidBlock);
Chunk[] chunks = new Chunk[] { createChunk(-1, 0, -1), createChunk(0, 0, -1), createChunk(1, 0, -1), createChunk(-1, 0, 0), chunk, createChunk(1, 0, 0), createChunk(-1, 0, 1), createChunk(0, 0, 1), createChunk(1, 0, 1) };
ChunkViewCore chunkView = new ChunkViewCoreImpl(chunks, new BlockRegion(0, 0, 0).expand(1, 0, 1), new Vector3i(1, 0, 1), airBlock);
assertEquals(solidBlock, chunkView.getBlock(0, 0, 0));
}
Aggregations