aboutsummaryrefslogtreecommitdiff
path: root/BerryClient/models/Wall.py
blob: 9904ebb98b4f5512a97fe0607bbb566b6d4972cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Wall:
    width: int = 6
    height: int = 5
    pos: tuple
    rotated: bool = False
    material_id: str = "stone"
    _bw: "BlockWorld"

    def __init__(self, pos, bw):
        self.pos = pos
        self._bw = bw

    def build(self):
        x, y, z = self.pos

        from_pos = (x,y,z)

        if self.rotated:
            z += self.width - 1
        else:
            x += self.width - 1
        y += self.height-1

        to_pos = (x,y,z)

        self._bw.set_blocks(*from_pos, *to_pos, self.material_id)