def makefoliage(self, mcmap):
        """note, foliage will disintegrate if there is no foliage below, or
        if there is no "log" block within range 2 (square) at the same level or
        one level below"""
        topy = self.pos[1] + self.height - 1
        start = topy - 2
        end = topy + 2
        for y in range(start, end):
            if y > start + 1:
                rad = 1
            else:
                rad = 2
            for xoff in range(-rad, rad + 1):
                for zoff in range(-rad, rad + 1):
                    if (random() > 0.618
                        and abs(xoff) == abs(zoff)
                        and abs(xoff) == rad
                    ):
                        continue

                    x = self.pos[0] + xoff
                    z = self.pos[2] + zoff

                    assign_value(x, y, z, LEAFINFO, mcmap)
note, foliage will disintegrate if there is no foliage below, or
        if there is no "log" block within range 2 (square) at the same level or
        one level below
stock-filters/Forester.py