private void UpdateStartSunlightChunk(int x, int y, int z) { int startx = (x / chunksize) * chunksize; int starty = (y / chunksize) * chunksize; int startz = (z / chunksize) * chunksize; for (int xx = 0; xx < chunksize; xx++) { for (int yy = 0; yy < chunksize; yy++) { int height = GetLightHeight(startx + xx, starty + yy); for (int zz = 0; zz < chunksize; zz++) { int light; if (startz + zz >= height) { light = sunlight; } else { light = minlight; } LightSetBlock(startx + xx, starty + yy, startz + zz, (byte)light); } } } chunklighted[x / chunksize, y / chunksize, z / chunksize] = true; }
private void UpdateStartSunlight(int x, int y, int z) { int height = GetLightHeight(x,y); int light; if (z >= height) { light = sunlight; } else { light = minlight; } LightSetBlock(x, y, z, (byte)light); }
public void ResetShadows() { light = null; lightheight = null; lightheight = new InfiniteHeightCache(); chunklighted = null; UpdateHeightCache(); loaded = true; light = new InfiniteMapCache(); chunklighted = new bool[map.MapSizeX / chunksize, map.MapSizeY / chunksize, map.MapSizeZ / chunksize]; }
private void UpdateLight() { light = new InfiniteMapCache(); UpdateHeightCache(); }
public void ResetShadows() { light = null; lightheight = null; lightheight = new InfiniteHeightCache(); chunklighted = null; UpdateHeightCache(); loaded = true; }