Buggy code:
public class SunlightRegenBatchPropagator implements BatchPropagator { private PropagationRules regenRules ; private PropagatorWorldView regenWorld ; private PropagatorWorldView sunlightWorld ; private BatchPropagator sunlightPropagator ; private Set < Vector3i > [ ] reduceQueues ; private Set < Vector3i > [ ] increaseQueues ; private Map < Side , Vector3i > chunkEdgeDeltas = Maps . newEnumMap ( Side . class ) ; public SunlightRegenBatchPropagator ( PropagationRules regenRules , PropagatorWorldView regenWorld , BatchPropagator sunlightPropagator , PropagatorWorldView sunlightWorld ) { } @ Override public void process ( BlockChange ... changes ) { } @ Override public void process ( Iterable < BlockChange > blockChanges ) { } private void reviewChange ( BlockChange blockChange ) { } private void reviewChangeToBottom ( BlockChange blockChange ) { } private void reviewChangeToTop ( BlockChange blockChange ) { } private void queueSpreadRegen ( Vector3i position , byte value ) { } private void processRegenReduction ( ) { } private void purge ( Vector3i pos ) { } private void processRegenIncrease ( ) { } private void push ( Vector3i pos , byte value ) { } private void cleanUp ( ) { } private void reduce ( Vector3i position , byte oldValue ) { } @ Override public void propagateBetween ( ChunkImpl chunk , ChunkImpl adjChunk , Side side , boolean propagateExternal ) { } private void markForPropagation ( ChunkImpl toChunk , int [ ] depth , int [ ] startingRegen , int [ ] adjDepths , int [ ] adjStartingRegen ) { Vector3i pos = new Vector3i ( ) ; for ( int z = 0 ; z < ( ChunkConstants . SIZE_Z ) ; ++ z ) { for ( int x = 0 ; x < ( ChunkConstants . SIZE_X ) ; ++ x ) { int depthIndex = x + ( ( ChunkConstants . SIZE_X ) * z ) ; int start = startingRegen [ depthIndex ] ; int adjStart = adjStartingRegen [ depthIndex ] ; if ( ( start - adjStart ) > 1 ) { int initialDepth = Math . max ( ( ( ChunkConstants . SUNLIGHT_REGEN_THRESHOLD ) - start ) , 0 ) ; int finalDepth = depth [ depthIndex ] ; <START_BUG> int strength = ( ( start + initialDepth ) - ( ChunkConstants . SUNLIGHT_REGEN_THRESHOLD ) ) + 1 ; <END_BUG> for ( int i = initialDepth ; i < finalDepth ; ++ i ) { sunlightPropagator . propagateFrom ( toChunk . getBlockWorldPos ( x , ( ( ( ChunkConstants . SIZE_Y ) - i ) - 1 ) , z ) , ( ( byte ) ( strength ) ) ) ; if ( strength < ( ChunkConstants . MAX_SUNLIGHT ) ) { strength ++ ; } } } else { int initialDepth = Math . max ( adjDepths [ depthIndex ] , ( ( ChunkConstants . SUNLIGHT_REGEN_THRESHOLD ) - start ) ) ; byte strength = ( ( byte ) ( Math . min ( MAX_SUNLIGHT , ( ( ( start + initialDepth ) - ( ChunkConstants . SUNLIGHT_REGEN_THRESHOLD ) ) + 1 ) ) ) ) ; for ( int i = initialDepth ; i < ( depth [ depthIndex ] ) ; ++ i ) { sunlightPropagator . propagateFrom ( toChunk . getBlockWorldPos ( x , ( ( ( ChunkConstants . SIZE_Y ) - i ) - 1 ) , z ) , strength ) ; if ( strength < ( ChunkConstants . MAX_SUNLIGHT ) ) { strength ++ ; } ( pos . y ) -- ; } } } } } private void propagateSweep ( ChunkImpl fromChunk , ChunkImpl toChunk , int [ ] depth , int [ ] startingRegen ) { } @ Override public void propagateFrom ( Vector3i pos , Block block ) { } @ Override public void propagateFrom ( Vector3i pos , byte value ) { } @ Override public void regenerate ( Vector3i pos , byte value ) { } }

Fix:
int strength = Math . min ( ( ( ( start + initialDepth ) - ( ChunkConstants . SUNLIGHT_REGEN_THRESHOLD ) ) + 1 ) , MAX_SUNLIGHT ) ;