mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-25 18:17:37 +01:00
FIx 1.11.2 and 1.12.2 lighting exception
This commit is contained in:
parent
e22ad9b8bf
commit
1e733a7d51
@ -186,20 +186,38 @@ public class ForgeMapChunkCache extends MapChunkCache
|
||||
int emit = 0, sky = 15;
|
||||
if (step.yoff != 0) { // Y coord - snap is valid already
|
||||
int ny = y + step.yoff;
|
||||
emit = snap.getBlockEmittedLight(x, ny, z);
|
||||
sky = snap.getBlockSkyLight(x, ny, z);
|
||||
emit = snap.getBlockEmittedLight(bx, ny, bz);
|
||||
sky = snap.getBlockSkyLight(bx, ny, bz);
|
||||
}
|
||||
else {
|
||||
int nx = x + step.xoff;
|
||||
int nz = z + step.zoff;
|
||||
int nchunkindex = ((nx >> 4) - x_min) + (((nz >> 4) - z_min) * x_dim);
|
||||
if ((nchunkindex < snapcnt) && (nchunkindex >= 0)) {
|
||||
emit = snaparray[nchunkindex].getBlockEmittedLight(nx, y, nz);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx, y, nz);
|
||||
emit = snaparray[nchunkindex].getBlockEmittedLight(nx & 0xF, y, nz & 0xF);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx & 0xF, y, nz & 0xF);
|
||||
}
|
||||
}
|
||||
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 & 0xF, ny, nz & 0xF);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx & 0xF, ny, nz & 0xF);
|
||||
}
|
||||
return (emit << 8) + sky;
|
||||
}
|
||||
|
||||
private void biomePrep()
|
||||
{
|
||||
if (sameneighborbiomecnt != null)
|
||||
|
@ -186,20 +186,37 @@ public class ForgeMapChunkCache extends MapChunkCache
|
||||
int emit = 0, sky = 15;
|
||||
if (step.yoff != 0) { // Y coord - snap is valid already
|
||||
int ny = y + step.yoff;
|
||||
emit = snap.getBlockEmittedLight(x, ny, z);
|
||||
sky = snap.getBlockSkyLight(x, ny, z);
|
||||
emit = snap.getBlockEmittedLight(bx, ny, bz);
|
||||
sky = snap.getBlockSkyLight(bx, ny, bz);
|
||||
}
|
||||
else {
|
||||
int nx = x + step.xoff;
|
||||
int nz = z + step.zoff;
|
||||
int nchunkindex = ((nx >> 4) - x_min) + (((nz >> 4) - z_min) * x_dim);
|
||||
if ((nchunkindex < snapcnt) && (nchunkindex >= 0)) {
|
||||
emit = snaparray[nchunkindex].getBlockEmittedLight(nx, y, nz);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx, y, nz);
|
||||
emit = snaparray[nchunkindex].getBlockEmittedLight(nx & 0xF, y, nz & 0xF);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx & 0xF, y, nz & 0xF);
|
||||
}
|
||||
}
|
||||
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 & 0xF, ny, nz & 0xF);
|
||||
sky = snaparray[nchunkindex].getBlockSkyLight(nx & 0xF, ny, nz & 0xF);
|
||||
}
|
||||
return (emit << 8) + sky;
|
||||
}
|
||||
|
||||
private void biomePrep()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user