38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from pyblockworld import World
|
|
from wall import Wall
|
|
class WallWithWindow(Wall):
|
|
__windowBlock:str
|
|
def __init__(self, x:float, y:float, z:float, block:str, window:str, world:World, width:int=10, height:int=5):
|
|
super().__init__(x, y, z, block, world, width, height)
|
|
self.__windowBlock = window
|
|
|
|
def build(self):
|
|
super().build()
|
|
|
|
if super().getLength() < 6:
|
|
x = super().getX()
|
|
y = super().getY() + 2
|
|
z = super().getZ() + 2
|
|
|
|
super().getWorld().setBlocks(
|
|
x,
|
|
y,
|
|
z,
|
|
x,
|
|
y + 1,
|
|
z + 2,
|
|
self.__windowBlock)
|
|
else:
|
|
x = super().getX()
|
|
y = super().getY() + 2
|
|
z = super().getZ() + 3
|
|
|
|
super().getWorld().setBlocks(
|
|
x,
|
|
y,
|
|
z,
|
|
x,
|
|
y + (super().getHeight()-4),
|
|
z + (super().getLength()-(super().getLength()/2)),
|
|
self.__windowBlock)
|