From 66e39f8b4d03d6930a387db4071ef467d74eef72 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Thu, 14 Oct 2010 14:02:04 -0400 Subject: [PATCH] made sure lava blocks are fully lit --- chunk.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/chunk.py b/chunk.py index 67571f2..510a4e2 100644 --- a/chunk.py +++ b/chunk.py @@ -372,9 +372,11 @@ class ChunkRenderer(object): # we have no useful info, return default return (self.calculate_darkness(15, 0), False) + blocktype = blocks[local_x, local_y, local_z] + # special handling for half-blocks # (don't recurse more than once!) - if blocks[local_x, local_y, local_z] == 44 and not norecurse: + if blocktype == 44 and not norecurse: # average gathering variables averagegather = 0.0 averagecount = 0 @@ -395,9 +397,13 @@ class ChunkRenderer(object): return (averagegather / averagecount, False) # calculate the return... - occluded = not (blocks[local_x, local_y, local_z] in transparent_blocks) + occluded = not (blocktype in transparent_blocks) + # only calculate the non-default coefficient if we're not occluded - if occluded: + if (blocktype == 10) or (blocktype == 11): + # lava blocks should always be lit! + coefficient = 0.0 + elif occluded: coefficient = self.calculate_darkness(15, 0) else: coefficient = self.calculate_darkness(skylight[local_x, local_y, local_z], blocklight[local_x, local_y, local_z])