예제 #1
0
    def regenerate_blocklight(self):
        lightmap = array("L", [0] * (16 * 16 * CHUNK_HEIGHT))

        for x, z, y in iterchunk():
            block = self.get_block((x, y, z))
            if block in glowing_blocks:
                composite_glow(lightmap, glowing_blocks[block], x, y, z)

        self.blocklight = array("B", [clamp(x, 0, 15) for x in lightmap])
예제 #2
0
파일: chunk.py 프로젝트: Zebetus/bravo
    def regenerate_blocklight(self):
        lightmap = array("L", [0] * (16 * 16 * CHUNK_HEIGHT))

        for x, z, y in iterchunk():
            block = self.get_block((x, y, z))
            if block in glowing_blocks:
                composite_glow(lightmap, glowing_blocks[block], x, y, z)

        self.blocklight = array("B", [clamp(x, 0, 15) for x in lightmap])
예제 #3
0
    def test_boring(self):
        if "boring" not in self.p:
            raise unittest.SkipTest("plugin not present")

        plugin = self.p["boring"]

        plugin.populate(self.chunk, 0)
        for x, z, y in iterchunk():
            if y < CHUNK_HEIGHT // 2:
                self.assertEqual(self.chunk.get_block((x, y, z)),
                    bravo.blocks.blocks["stone"].slot)
            else:
                self.assertEqual(self.chunk.get_block((x, y, z)),
                    bravo.blocks.blocks["air"].slot)