إصلاح إحداثيات الخلل واتجاه الباب
This commit is contained in:
6
main.py
6
main.py
@@ -6,26 +6,28 @@ from utils.YamlReader import YamlReader
|
||||
from buildings.Building import Building
|
||||
|
||||
from utils.functions import *
|
||||
from utils.Enums import DIRECTION
|
||||
|
||||
editor = Editor(buffering=True)
|
||||
|
||||
# get every differents buildings shapes
|
||||
f = JsonReader('buildings\shapes.json')
|
||||
shapes = f.data
|
||||
baseShape = shapes[0]['matrice']
|
||||
|
||||
# get the random data for the buildings
|
||||
y = YamlReader('params.yml')
|
||||
random_data = y.data
|
||||
|
||||
#move your editor to the position you wanna build on
|
||||
transform = Transform((0,-60,110),rotation = 0)
|
||||
transform = Transform((75,-60,110),rotation = 0)
|
||||
editor.transform.push(transform)
|
||||
|
||||
# clear the area you build on
|
||||
geometry.placeCuboid(editor, (-5,0,-8), (25,100,25), Block("air"))
|
||||
|
||||
# create a building at the relative position 0,0 with 20 blocks length and 20 blocks width, with a normal shape and 10 floors
|
||||
building = Building(random_data["buildings"], (0, 0), (20,20), shapes[0]['matrice'], 10)
|
||||
building = Building(random_data["buildings"], [(0,0,0), (20,30,20)], baseShape, DIRECTION.EAST)
|
||||
# build it with your custom materials
|
||||
building.build(editor, ["stone_bricks","glass_pane","glass","cobblestone_wall","stone_brick_stairs","oak_planks","white_concrete","cobblestone","stone_brick_slab","iron_bars"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user