Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setSunlight(at, val):
- sunlightDict[at]=val
- def getSunlight(at):
- if(getBlock(at) != None):
- return 0
- return sunlightDict[at]
- def afterPlaceBlock(position):
- placeOneMoreLayerOfSunlight()
- def recalc(v,ignore=None):
- if(v.xmi refers to v and v.xmi != ignore) recalc(v.xmi, ignore=v)
- if(v.xpl refers to v and v.xpl != ignore) recalc(v.xpl, ignore=v)
- if(v.zmi refers to v and v.zmi != ignore) recalc(v.zmi, ignore=v)
- if(v.zpl refers to v and v.zpl != ignore) recalc(v.zpl, ignore=v)
- if(v.ymi refers to v and v.ymi != ignore) recalc(v.ymi, ignore=v)
- if(getBlock(v) != None):
- setSunlight(at=v, val=0)
- else:
- setSunlight(at=v, val=math.max(getSunlight(v.xmi)-1,getSunlight(v.xpl)-1,getSunlight(v.zmi)-1,getSunlight(v.zpl)-1,getSunlight(v.ypl)))
- recalc(position, ignore=None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement