def setupPreview(self):
        """
        Creates the Brush Preview
        Passes it as a FakeLevel object to the renderer
        Called whenever the preview needs to be recalculated
        """
        brushSize = self.getBrushSize()
        brushStyle = self.options['Style']
        key = getattr(self.brushMode, 'mainBlock', 'Block')
        blockInfo = self.options[key]

        class FakeLevel(pymclevel.MCLevel):
            filename = "Fake Level"
            materials = self.editor.level.materials
            root_tag = "Dummy"

            _gamePlatform = "Unknown"

            def __init__(self):
                self.chunkCache = {}

            Width, Height, Length = brushSize
            if self.editor.level.gamePlatform == "PE" and self.editor.level.world_version == "1.plus":
                Height = 16
            else:
                Height = self.editor.level.Height
            zerolight = numpy.zeros((16, 16, Height), dtype='uint8')
            zerolight[:] = 15

            def getChunk(self, cx, cz):
                if (cx, cz) in self.chunkCache:
                    return self.chunkCache[cx, cz]

                class FakeBrushChunk(pymclevel.level.FakeChunk):
                    Entities = []
                    TileEntities = []

                f = FakeBrushChunk()
                f.world = self
                f.chunkPosition = (cx, cz)

                mask = createBrushMask(brushSize, brushStyle, (0, 0, 0), BoundingBox((cx << 4, 0, cz << 4), (16, self.Height, 16)))
                f.Blocks = numpy.zeros(mask.shape, dtype='uint8')
                f.Data = numpy.zeros(mask.shape, dtype='uint8')
                f.BlockLight = self.zerolight
                f.SkyLight = self.zerolight

                if blockInfo.ID:
                    f.Blocks[mask] = blockInfo.ID
                    f.Data[mask] = blockInfo.blockData

                else:
                    f.Blocks[mask] = 255
                self.chunkCache[cx, cz] = f
                return f

        self.level = FakeLevel()
        CloneTool.setupPreview(self, alpha=self.settings['brushAlpha'])

        Creates the Brush Preview
        Passes it as a FakeLevel object to the renderer
        Called whenever the preview needs to be recalculated
        
editortools/brush.py