public void Set(I val, int x, int y, int z) { Vector3i chunkPos = Chunk.ToChunkPosition(x, y, z); Vector3i localPos = Chunk.ToLocalPosition(x, y, z); Chunk3D <I> chunk = GetChunkInstance(chunkPos); chunk.Set(val, localPos); }
public bool SetMaxLight(byte light, int x, int y, int z) { Vector3i chunkPos = Chunk.ToChunkPosition(x, y, z); Vector3i localPos = Chunk.ToLocalPosition(x, y, z); Chunk3D <byte> chunk = lights.GetChunkInstance(chunkPos); byte oldLight = chunk.Get(localPos); if (oldLight < light) { chunk.Set(light, localPos); return(true); } return(false); }