コード例 #1
0
ファイル: test_dig_hooks.py プロジェクト: gr8firedragon/bravo
    def test_unbreakable_block(self):
        """
        Bedrock shouldn't be affected by digging.
        """

        chunk = bravo.chunk.Chunk(0, 0)
        chunk.set_block((0, 0, 0), bravo.blocks.blocks["bedrock"].slot)

        self.hook.dig_hook(None, chunk, 0, 0, 0,
            bravo.blocks.blocks["bedrock"])

        self.assertEqual(chunk.get_block((0, 0, 0)),
            bravo.blocks.blocks["bedrock"].slot)
コード例 #2
0
ファイル: test_dig_hooks.py プロジェクト: gr8firedragon/bravo
    def test_dirt(self):
        """
        Dirt should be replaced by air.

        Nothing special about dirt, really, but it's the obvious thing to dig.
        """

        chunk = bravo.chunk.Chunk(0, 0)
        chunk.set_block((0, 0, 0), bravo.blocks.blocks["dirt"].slot)

        self.hook.dig_hook(None, chunk, 0, 0, 0, bravo.blocks.blocks["dirt"])

        self.assertEqual(chunk.get_block((0, 0, 0)),
            bravo.blocks.blocks["air"].slot)