Block lighting fixes
- Check for luminance as well when optimizing lightmap retrieval - Use vanilla fix for underwater lighting
This commit is contained in:
1 parent
a7eafdebc6
commit
dc70f71f84
1 file changed
+4
-4
+4
-4
@@ -62,21 +62,21 @@ public abstract class LightDataAccess {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
|
||||
float ao;
|
||||
boolean em;
|
||||
|
||||
if (state.getLuminance() == 0) {
|
||||
ao = state.getAmbientOcclusionLightLevel(world, pos);
|
||||
em = state.hasEmissiveLighting(world, pos);
|
||||
} else {
|
||||
ao = 1.0f;
|
||||
em = true;
|
||||
}
|
||||
|
||||
// FIX: Fluids are always non-translucent despite blocking light, so we need a special check here in order to
|
||||
// solve lighting issues underwater.
|
||||
boolean op = state.getFluidState() != EMPTY_FLUID_STATE || state.getOpacity(world, pos) == 0;
|
||||
boolean fo = state.isOpaqueFullCube(world, pos);
|
||||
boolean em = state.hasEmissiveLighting(world, pos);
|
||||
|
||||
// OPTIMIZE: Do not calculate lightmap data if the block is full and opaque.
|
||||
// FIX: Calculate lightmap data for emissive blocks (currently only magma), even though they are full and opaque.
|
||||
// FIX: Calculate lightmap data for light-emitting or emissive blocks, even though they are full and opaque.
|
||||
int lm = (fo && !em) ? 0 : WorldRenderer.getLightmapCoordinates(world, state, pos);
|
||||
|
||||
return packAO(ao) | packLM(lm) | packOP(op) | packFO(fo) | (1L << 60);
|
||||
|
||||
Reference in new issue
Block a user