def construct(self, level, coords, door_coords, surface): # This is assumes box is already the size of the house minx = surface.to_real_x(coords[0][0]) minz = surface.to_real_z(coords[0][1]) maxx = surface.to_real_x(coords[1][0]) maxz = surface.to_real_z(coords[1][1]) block = surface.surface_map[coords[0][0]][coords[0][1]] door_coords = (surface.to_real_x(door_coords[0]), surface.to_real_z(door_coords[1])) miny = block.height biome = block.biome_id wall_block = BlockUtils.get_wall_block(biome) door_block = BlockUtils.get_door_block(biome) pillar_block = BlockUtils.get_beam_block(biome) height_offset = RandUtils.rand_range(minx, miny, 10, 5) pillar_height = miny + height_offset level_coords = ((minx, minz, miny), (maxx, maxz, pillar_height)) remove_blocks_in_box(level, level_coords) construct_pillars(level, level_coords, biome, pillar_height) construct_walls(level, level_coords, biome, pillar_height) construct_floor_and_flat_roof(level, level_coords, biome, pillar_height) construct_pointed_roof(level, level_coords, biome, pillar_height) place_door(level, level_coords, biome, door_coords) place_windows(level, level_coords, biome, height_offset) coords = shrink_building_lot(coords, miny) minx = surface.to_real_x(coords[0][0]) minz = surface.to_real_z(coords[0][1]) maxx = surface.to_real_x(coords[1][0]) maxz = surface.to_real_z(coords[1][1]) inside_coords = ((minx, minz, miny), (maxx, maxz)) place_furniture(level, inside_coords, biome)
def construct_pillars(level, coords, biome, height): minx, minz, miny, maxx, maxz = get_coords(coords) pillar_block = BlockUtils.get_beam_block(biome) for y in range(height, 0, -1): for x in [minx, maxx - 1]: for z in [minz, maxz - 1]: block = level.blockAt(x, y, z) if block in surface_blocks or block == 9: utilityFunctions.setBlock(level, pillar_block, x, y, z)
def construct(self, level, coords, door_coords, surface): # This is assumes box is already the size of the house minx = surface.to_real_x(coords[0][0]) minz = surface.to_real_z(coords[0][1]) maxx = surface.to_real_x(coords[1][0]) maxz = surface.to_real_z(coords[1][1]) block = surface.surface_map[coords[0][0]][coords[0][1]] miny = block.height biome = block.biome_id crop_block = BlockUtils.get_crop_block(biome) spacer_block = BlockUtils.get_beam_block(biome) height_offset = RandUtils.rand_range(minx, miny, 10, 5) pillar_height = miny + height_offset level_coords = ((minx, minz, miny), (maxx, maxz, pillar_height)) remove_blocks_in_box(level, level_coords) construct_farm(level, level_coords, biome)