Further handle broken lighting data... start builder pattern for

blockstate
This commit is contained in:
Mike Primm 2021-12-24 10:19:02 -06:00
parent 67ab35658c
commit 05819b1b74
2 changed files with 56 additions and 9 deletions

View file

@ -128,12 +128,8 @@ public class GenericChunk {
int idx = (z << 4) + x;
for (int y = 15; y >= 0; y--) {
DynmapBlockState bs = sections[i].blocks.getBlock(x, y, z); // Get block
if (bs.isWater() || bs.isWaterlogged()) { // Drop light by 1 level for water
sky[idx] = sky[idx] < 1 ? 0 : sky[idx] - 1;
}
else if (bs.isLeaves()) { // Drop light by 2 levels for leaves
sky[idx] = sky[idx] < 2 ? 0 : sky[idx] - 2;
}
int atten = bs.lightAttenuation;
sky[idx] = (sky[idx] > atten) ? (sky[idx] - atten) : 0;
ssky[(y << 7) | (z << 3) | (x >> 1)] |= (sky[idx] << (4 * (x & 1)));
}
}