Example #1
0
 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;
 }
Example #2
0
 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);
 }
Example #3
0
 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];
 }
Example #4
0
 private void UpdateLight()
 {
     light = new InfiniteMapCache();
     UpdateHeightCache();
 }
Example #5
0
 public void ResetShadows()
 {
     light = null;
     lightheight = null;
     lightheight = new InfiniteHeightCache();
     chunklighted = null;
     UpdateHeightCache();
     loaded = true;
 }