From 03af37b3fe4d18ad61d9cda5e59f9e8f7084c96c Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 2 Mar 2016 02:45:25 -1000 Subject: [PATCH] Skylight update now draws light in below changed columns. --- src/mceditlib/relight/with_cython.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mceditlib/relight/with_cython.pyx b/src/mceditlib/relight/with_cython.pyx index 695d38e..5b3bdf0 100644 --- a/src/mceditlib/relight/with_cython.pyx +++ b/src/mceditlib/relight/with_cython.pyx @@ -377,6 +377,20 @@ cdef updateSkyLight(RelightCtx ctx, # Update chunk height map ctx.setHeightMap(x, z, h) + # Find all blocks below the changed column heights that have themselves changed, and + # draw light from adjacent chunks. + + for i in range(n): + x = ax[i] + y = ay[i] + z = az[i] + k = chunk_key(x, z) + h = newHeights[k] + if y < h: # and (x & 0xF == 0)? + drawLight(ctx, x, y, z) + spreadLight(ctx, x, y, z) + + #print("Dimming %d, brightening %d" % (dimCoords.size(), litCoords.size())) for c in dimCoords: oldLight = ctx.getBlockLight(c.x, c.y, c.z)