Start prep for shadow lighting rework

This commit is contained in:
Mike Primm 2022-01-30 14:23:00 -06:00
parent fd420f739f
commit e22ad9b8bf
6 changed files with 96 additions and 3 deletions

View file

@ -201,6 +201,23 @@ public class ForgeMapChunkCache extends MapChunkCache
}
return (emit << 8) + sky;
}
@Override
/**
* Get block sky and emitted light, relative to current coordinate
* @return (emitted light * 256) + sky light
*/
public final int getBlockLight(int xoff, int yoff, int zoff) {
int emit = 0, sky = 15;
int nx = x + xoff;
int ny = y + yoff;
int nz = z + zoff;
int nchunkindex = ((nx >> 4) - x_min) + (((nz >> 4) - z_min) * x_dim);
if ((nchunkindex < snapcnt) && (nchunkindex >= 0)) {
emit = snaparray[nchunkindex].getBlockEmittedLight(nx, ny, nz);
sky = snaparray[nchunkindex].getBlockSkyLight(nx, ny, nz);
}
return (emit << 8) + sky;
}
private void biomePrep()
{