use of org.terasology.engine.world.chunks.Chunk in project Terasology by MovingBlocks.
the class WorldProviderCoreImpl method getLight.
@Override
public byte getLight(int x, int y, int z) {
Vector3i chunkPos = Chunks.toChunkPos(x, y, z, new Vector3i());
Chunk chunk = chunkProvider.getChunk(chunkPos);
if (chunk != null) {
Vector3i blockPos = Chunks.toRelative(x, y, z, new Vector3i());
return chunk.getLight(blockPos);
}
return 0;
}
use of org.terasology.engine.world.chunks.Chunk in project Terasology by MovingBlocks.
the class LocalChunkView method getBlockAt.
@Override
public Block getBlockAt(Vector3ic pos) {
int index = chunkIndexOf(pos);
Chunk chunk = chunks[index];
if (chunk != null) {
return chunk.getBlock(Chunks.toRelative(pos, new Vector3i()));
}
return null;
}
Aggregations