Files
pyblock-exporer/wall.py
2023-10-25 07:33:09 +02:00

30 lines
904 B
Python

from pyblockworld import World
class Wall:
__length:int
__width:int
__height:int
__rotated:bool
__x:float
__y:float
__z:float
__world:World
__block:str
def __init__(self, x:float, y:float, z:float, block:str, world:World, length=10, width=10, height=5, rotated=False):
self.__width = width
self.__length = length
self.__height = height
self.__x = x
self.__y = y - 1
self.__z = z
self.__world = world
self.__rotated = rotated
self.__block = block
def build(self):
if self.__rotated:
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x + self.__width, self.__y + self.__height, self.__z, self.__block)
else:
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x, self.__y + self.__height, self.__z + self.__length, self.__block)