Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,12 @@ private void spreadLightFromCursor(final byte currentLight, final EnumSkyBlock l

final BlockPos neighborBlockPos = neighborInfo.mutableBlockPos;

final byte newLight = (byte) (currentLight - getPosOpacity(neighborBlockPos, neighborChunk.getBlockState(neighborBlockPos), neighborChunk));
final IBlockState neighborState = neighborChunk.getBlockState(neighborBlockPos);
final byte propagatedLight = (byte) (currentLight - getPosOpacity(neighborBlockPos, neighborState, neighborChunk));
// A neighbour reached by propagation must not drop below its own emission: an emitting block (e.g. lava at 15) that is not scheduled itself would otherwise keep the lower value.
// Sky light is excluded because its source is the sky, not the block itself.
final byte ownLight = lightType == EnumSkyBlock.BLOCK ? (byte) ClampUtil.clampMinFirst(LightUtil.getLightValueForPos(neighborState, world, neighborBlockPos, neighborChunk), 0, MAX_LIGHT_LEVEL) : 0;
final byte newLight = (byte) Math.max(propagatedLight, ownLight);

if (newLight > neighborInfo.light)
enqueueBrightening(neighborBlockPos, neighborInfo.key, newLight, neighborChunk, lightType);
Expand Down