Esempio n. 1
0
def building_pattern(player_z):
    b = {}
    # start point of tunnel
    x1 = 69
    x2 = 9
    task4_x1 = 93
    y1 = 14
    z = player_z
    num_segments = x1 - x2 + 1

    # store node types in variables for easier use
    ph = get_answer_placeholders()[0]
    if "param2" in ph:
        stair_up_x = {"name": "stairs:stair_stonebrick", "param2": "1"}
    else:
        stair_up_x = {"name": "stairs:stair_stonebrick", "direction": "+x"}
    rail = 'carts:rail'
    power_rail = 'carts:powerrail'

    # sloping section of tunnel
    for i in range(num_segments):
        # Add stairs - Don't need stairs on very last block. Hence check i < 60
        if i < 60:
            b.update(nodebuilder.build(x1 - i, y1 - i, z - 1, stair_up_x))
        # Add power rail
        b.update(nodebuilder.build(x1 - i, y1 - i + 1, z, power_rail))

    # flat section of tunnel
    for x in range(x1, task4_x1 + 1):
        # Add rail or power rail in pairs
        if x // 2 % 2 == 0:
            b.update(nodebuilder.build(x, y1 + 1, z, rail))
        else:
            b.update(nodebuilder.build(x, y1 + 1, z, power_rail))
    return b
Esempio n. 2
0
def building_pattern(player_z):
    b = {}
    # BUILDING MATERIALS
    air = "air"
    wall = "default:glass"
    floor = "default:stone"
    torch = "default:torch"
    # BUILDING LOCATION
    path_x_min = 105
    floor_y = 9
    # BUILDING SIZE
    arch_height = 7
    arch_width = 5
    path_length = 16
    # ENGINEERING CALCULATIONS
    wall_z = player_z - arch_width // 2
    range_x_arch = range(path_x_min, path_x_min + path_length, 4)
    range_y_ext = range(floor_y, floor_y + arch_height)
    range_z_ext = range(wall_z, wall_z + arch_width)
    range_y_int = range(floor_y + 1, floor_y + arch_height - 1)
    range_z_int = range(wall_z + 1, wall_z + arch_width - 1)
    # BUILD
    b.update(
        nodebuilder.build(range(path_x_min, path_x_min + 40),
                          range(floor_y + 1, floor_y + 31),
                          range(player_z - 4, player_z + 5), air))
    b.update(nodebuilder.build(range_x_arch, range_y_ext, range_z_ext, wall))
    b.update(nodebuilder.build(range_x_arch, range_y_int, range_z_int, air))
    b.update(nodebuilder.build(range_x_arch, floor_y, range_z_int, floor))
    b.update(nodebuilder.build(range_x_arch, floor_y + 1, player_z + 1, torch))
    return b
Esempio n. 3
0
def building_pattern(player_z):
    ref_z = player_z
    wool = r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)"
    # position of centre of diamond
    cx = 100
    cy = 32
    z = player_z

    # array of node types which we will alternate through
    colours = [wool, wool]

    # calculate extents of diamond
    width = 21
    height = 21
    x1 = cx - width // 2
    y1 = cy - height // 2
    x2 = x1 + width
    y2 = y1 + height
    b = nodebuilder.build(range(x1,x2),range(y1,y2),ref_z,"air")
    for y in range(y1,y2):
        # calculate x range which will give diamond shape
        xlo = x1 + abs(y - cy)
        xhi = x2 - abs(y - cy)
        for x in range(xlo,xhi):
            # set each node to an alternate wool colour by adding position to node list
            b.update(nodebuilder.build(x, y, z, colours[(x+y)%2]))
    return b
Esempio n. 4
0
def building_pattern(player_z):
    ref_z = player_z
    b = {}
    # glass = "default:glass"
    # wool = r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)"
    air = "air"
    wall = "default:glass"
    # BUILDING LOCATION
    x_max = 93
    x_min = 70
    floor_y = 14
    # BUILDING SIZE
    tunnel_height = 7
    tunnel_width = 5
    # ENGINEERING CALCULATIONS
    tunnel_length = x_max - x_min + 1
    wall_z = player_z - tunnel_width // 2
    range_x = range(x_min, x_min + tunnel_length)
    range_y_ext = range(floor_y, floor_y + tunnel_height)
    range_z_ext = range(wall_z, wall_z + tunnel_width)
    range_y_int = range(floor_y + 1, floor_y + tunnel_height - 1)
    range_z_int = range(wall_z + 1, wall_z + tunnel_width - 1)
    # BUILD
    b.update(nodebuilder.build(range_x, range_y_ext, range_z_ext, wall))
    # replace the internal glass with air so left with a hollow tunnel
    b.update(nodebuilder.build(range_x, range_y_int, range_z_int, air))
    return b
Esempio n. 5
0
def building_pattern(player_z):
    b = {}
    air = "air"
    wall = "default:glass"
    floor = "default:stone"
    torch = "(default:torch|air)"
    # BUILDING LOCATION
    x_max = 93
    x_min = 70
    floor_y = 14
    # BUILDING SIZE
    tunnel_height = 7
    tunnel_width = 5
    # ENGINEERING CALCULATIONS
    tunnel_length = x_max - x_min + 1
    wall_z = player_z - tunnel_width // 2
    range_x = range(x_min, x_min + tunnel_length)
    range_y_ext = range(floor_y, floor_y + tunnel_height)
    range_z_ext = range(wall_z, wall_z + tunnel_width)
    range_y_int = range(floor_y + 1, floor_y + tunnel_height - 1)
    range_z_int = range(wall_z + 1, wall_z + tunnel_width - 1)
    # range_x_torch = range(x_min, x_min + tunnel_length, 4)
    # BUILD
    b.update(nodebuilder.build(range_x, range_y_ext, range_z_ext, wall))
    b.update(nodebuilder.build(range_x, range_y_int, range_z_int, air))
    b.update(nodebuilder.build(range_x, floor_y, range_z_int, floor))
    b.update(nodebuilder.build(range_x, floor_y + 1, player_z + 1, torch))
    return b
Esempio n. 6
0
def building_pattern(player_z):
    ref_z = player_z

    b = {}
    glass = "default:glass"
    wool = r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)"

    b.update(nodebuilder.build((99, 100, 101), (13, 14, 15), (ref_z - 1, ref_z, ref_z + 1), glass))
    b.update(nodebuilder.build(100, 14, ref_z, wool))
    return b
Esempio n. 7
0
def building_pattern(player_z):
    ref_z = player_z

    b = {}
    glass = "default:obsidian_glass"

    b.update(nodebuilder.build(101, (13, 14, 15), (ref_z - 1, ref_z, ref_z + 1), glass))
    return b
Esempio n. 8
0
def building_pattern(player_z):
    b = {}
    # Location of end points of sloping section of tunnel (centre of floor)
    x1 = 69
    y1 = 14
    x2 = 9
    ref_z = player_z

    # Dimensions
    tunnel_height = 7
    tunnel_width = 5
    num_segments = x1 - x2 + 1

    # Building materials
    glass = "default:glass"
    floor = "default:stone"
    torch = "default:torch"
    air = "air"

    # Make the full tunnel in solid glass and stone first
    for i in range(num_segments):
        # Cross section of tunnel at position i
        # x, y, z are coordinates of lower left corner of segment of tunnel
        x = x1 - i
        y = y1 - i
        z = ref_z - tunnel_width // 2
        # Build 5 x 7 blocks of glass at position i for walls, roof, and centre
        range_y_ext = range(y, y + tunnel_height)
        range_z_ext = range(z, z + tunnel_width)
        b.update(nodebuilder.build(x, range_y_ext, range_z_ext, glass))
        # Build 3 x 1 blocks of stone at position i for floor
        range_z_floor = (z + 1, z + 2, z + 3)
        b.update(nodebuilder.build(x, y, range_z_floor, floor))
    # hollow out the tunnel because now we are sure that lava and water can't flow in the ends
    for i in range(num_segments):
        # Use air to hollow out the tunnel
        x = x1 - i
        y = y1 - i
        z = ref_z - tunnel_width // 2
        range_y_air = range(y + 1, y + tunnel_height - 1)
        range_z_air = (z + 1, z + 2, z + 3)
        b.update(nodebuilder.build(x, range_y_air, range_z_air, air))
        if i % 4 == 0:
            # Place torches down the right hand side of the tunnel
            b.update(nodebuilder.build(x, y + 1, ref_z + 1, torch))
    return b
Esempio n. 9
0
def building_pattern(player_z):
    b = {}
    path_x_min = 105
    castle_x_min = 121
    floor_y = 9
    # BUILDING SIZE
    castle_length = 9
    castle_width = 5
    castle_height = 5
    # BUILDING MATERIALS
    air = "air"
    castle = "default:stone"
    window_x = {'name':"xpanes:bar_flat", 'direction':r'(\+|\-)x'}
    window_z = {'name':"xpanes:bar_flat", 'direction':r'(\+|\-)z'}
    # ENGINEERING CALCULATIONS
    wall_z1 = player_z - castle_width // 2
    wall_z2 = player_z + castle_width // 2
    range_x_castle_ext = range(castle_x_min, castle_x_min + castle_length)
    range_y_castle_ext = range(floor_y, floor_y + castle_height)
    range_z_castle_ext = range(wall_z1, wall_z1 + castle_width)
    range_x_castle_int = range(castle_x_min + 1, castle_x_min + castle_length - 1)
    range_y_castle_int = range(floor_y + 1, floor_y + castle_height)
    range_z_castle_int = range(wall_z1 + 1, wall_z1 + castle_width - 1)
    range_y_window = range(floor_y + 2, floor_y + castle_height)
    range_x_window = range(castle_x_min + 2, castle_x_min + castle_length - 2, 2)
    # BUILD
    b.update(nodebuilder.build(range(castle_x_min - 1, castle_x_min + castle_length + 10), range(floor_y + 1, floor_y + 31), range(player_z - 4, player_z + 5), air))
    b.update(nodebuilder.build(range_x_castle_ext, range_y_castle_ext, range_z_castle_ext, castle))
    b.update(nodebuilder.build(range_x_castle_int, range_y_castle_int, range_z_castle_int, air))
    b.update(nodebuilder.build(castle_x_min, [floor_y + 1, floor_y + 2], player_z, air))
    b.update(nodebuilder.build(range_x_window, range_y_window, (wall_z1, wall_z2), window_z))
    b.update(nodebuilder.build(castle_x_min, floor_y + 4, (player_z - 1, player_z, player_z + 1), window_x))
    return b
Esempio n. 10
0
def building_pattern(player_z):
    b = {}
    # BUILDING MATERIALS
    air = "air"
    wall = "default:glass"
    # BUILDING LOCATION
    path_x_min = 105
    floor_y = 9
    # BUILDING SIZE
    arch_height = 7
    arch_width = 5
    # ENGINEERING CALCULATIONS
    wall_z = player_z - arch_width // 2
    range_x_arch = path_x_min
    range_y_ext = range(floor_y, floor_y + arch_height)
    range_z_ext = range(wall_z, wall_z + arch_width)
    # BUILD
    b.update(
        nodebuilder.build(range(path_x_min, path_x_min + 40),
                          range(floor_y + 1, floor_y + 31),
                          range(player_z - 4, player_z + 5), air))
    b.update(nodebuilder.build(range_x_arch, range_y_ext, range_z_ext, wall))
    return b
Esempio n. 11
0
def building_pattern(player_z):
    b = {}
    path_x_min = 105
    castle_x_min = 121
    floor_y = 9
    # BUILDING SIZE
    castle_length = 9
    castle_width = 5
    castle_height = 5
    # BUILDING MATERIALS
    air = "air"
    castle = "default:stone"
    # ENGINEERING CALCULATIONS
    wall_z = player_z - castle_width // 2
    range_x_castle_ext = range(castle_x_min, castle_x_min + castle_length)
    range_y_castle_ext = range(floor_y, floor_y + castle_height)
    range_z_castle_ext = range(wall_z, wall_z + castle_width)
    range_x_castle_int = range(castle_x_min + 1,
                               castle_x_min + castle_length - 1)
    range_y_castle_int = range(floor_y + 1, floor_y + castle_height)
    range_z_castle_int = range(wall_z + 1, wall_z + castle_width - 1)
    # BUILD
    b.update(
        nodebuilder.build(
            range(castle_x_min - 1, castle_x_min + castle_length + 10),
            range(floor_y + 1, floor_y + 31), range(player_z - 4,
                                                    player_z + 5), air))
    b.update(
        nodebuilder.build(range_x_castle_ext, range_y_castle_ext,
                          range_z_castle_ext, castle))
    b.update(
        nodebuilder.build(range_x_castle_int, range_y_castle_int,
                          range_z_castle_int, air))
    b.update(
        nodebuilder.build(castle_x_min, [floor_y + 1, floor_y + 2], player_z,
                          air))
    return b
Esempio n. 12
0
def building_pattern(player_z):
    return nodebuilder.build(100, 14, player_z, r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)")
Esempio n. 13
0
def building_pattern(player_z):
    b = {}
    # position of centre of square
    wool = r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)"
    b.update(nodebuilder.build(range(x1, x2), range(y1, y2), z, wool))
    return b
Esempio n. 14
0
def building_pattern(player_z):
    b = {}
    path_x_min = 105
    castle_x_min = 121
    floor_y = 9
    # BUILDING SIZE
    castle_length = 9
    castle_width = 5
    castle_height = 5
    # BUILDING MATERIALS
    air = "air"
    castle = "default:stone"
    window_x = {'name': "xpanes:bar_flat", 'direction': r'\+x'}
    window_z = {'name': "xpanes:bar_flat", 'direction': r'\+z'}
    ladder = {"name": "default:ladder_wood", "direction": r"\+x"}
    carpet = r"wool:(white|grey|dark_grey|black|blue|cyan|green|dark_green|yellow|orange|brown|red|pink|magenta|violet)"
    door = {
        "name": r"doors:door_(wood|glass|obsidian_glass|steel)_\w",
        "direction": r"(\+|\-)(x|z)"
    }
    torch_n = {"name": "default:torch_wall", "direction": r"\-z"}
    torch_s = {"name": "default:torch_wall", "direction": r"\+z"}
    # ENGINEERING CALCULATIONS
    wall_z1 = player_z - castle_width // 2
    wall_z2 = player_z + castle_width // 2
    range_x_castle_ext = range(castle_x_min, castle_x_min + castle_length)
    range_y_castle_ext = range(floor_y, floor_y + castle_height)
    range_z_castle_ext = range(wall_z1, wall_z1 + castle_width)
    range_x_castle_int = range(castle_x_min + 1,
                               castle_x_min + castle_length - 1)
    range_y_castle_int = range(floor_y + 1, floor_y + castle_height)
    range_z_castle_int = range(wall_z1 + 1, wall_z1 + castle_width - 1)
    range_y_window = range(floor_y + 2, floor_y + castle_height)
    range_x_window = range(castle_x_min + 2, castle_x_min + castle_length - 2,
                           2)
    range_x_roof_ext = range(castle_x_min - 1,
                             castle_x_min + castle_length + 1)
    range_y_roof_ext = range(floor_y + castle_height,
                             floor_y + castle_height + 3)
    range_z_roof_ext = range(wall_z1 - 1, wall_z1 + castle_width + 1)
    range_x_roof_int = range_x_castle_ext
    range_y_roof_int = range(floor_y + castle_height + 1,
                             floor_y + castle_height + 3)
    range_z_roof_int = range_z_castle_ext
    crenel_y = floor_y + castle_height + 2
    roof_x1 = castle_x_min - 1
    roof_x2 = castle_x_min + castle_length
    roof_z1 = wall_z1 - 1
    roof_z2 = wall_z2 + 1
    # BUILD
    b.update(
        nodebuilder.build(
            range(castle_x_min - 1, castle_x_min + castle_length + 10),
            range(floor_y + 1, floor_y + 31), range(player_z - 4,
                                                    player_z + 5), air))
    b.update(
        nodebuilder.build(range_x_castle_ext, range_y_castle_ext,
                          range_z_castle_ext, castle))
    b.update(
        nodebuilder.build(range_x_castle_int, range_y_castle_int,
                          range_z_castle_int, air))
    b.update(
        nodebuilder.build(castle_x_min, [floor_y + 1, floor_y + 2], player_z,
                          air))
    b.update(
        nodebuilder.build(range_x_window, range_y_window, (wall_z1, wall_z2),
                          window_z))
    b.update(
        nodebuilder.build(castle_x_min, floor_y + 4,
                          (player_z - 1, player_z, player_z + 1), window_x))
    b.update(
        nodebuilder.build(range_x_roof_ext, range_y_roof_ext, range_z_roof_ext,
                          castle))
    b.update(
        nodebuilder.build(range_x_roof_int, range_y_roof_int, range_z_roof_int,
                          air))
    b.update(
        nodebuilder.build(castle_x_min + castle_length - 2,
                          range(floor_y + 1, floor_y + castle_height + 1),
                          player_z, ladder))
    b.update(
        nodebuilder.build((roof_x1, roof_x2), crenel_y,
                          range(wall_z1, wall_z1 + castle_width, 2), air))
    b.update(
        nodebuilder.build(range(castle_x_min, castle_x_min + castle_length, 2),
                          crenel_y, (roof_z1, roof_z2), air))
    b.update(nodebuilder.build(castle_x_min, floor_y + 1, player_z, door))
    b.update(
        nodebuilder.build(range(path_x_min, castle_x_min + castle_length - 1),
                          floor_y, player_z, carpet))
    b.update(
        nodebuilder.build(
            range(castle_x_min + 1, castle_x_min + castle_length - 1, 2),
            floor_y + 3, wall_z1 + 1, torch_n))
    b.update(
        nodebuilder.build(
            range(castle_x_min + 1, castle_x_min + castle_length - 1, 2),
            floor_y + 3, wall_z2 - 1, torch_s))
    return b