from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() ref_x = 100 ref_y = 14 ref_z = player_z # Alternatively type your unique z value instead of player_z wool = "wool:blue" b.build(ref_x, ref_y, ref_z, wool) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # BUILDING LOCATION ref_z = player_z x_max = 93 x_min = 70 floor_y = 14 # BUILDING SIZE tunnel_height = 7 tunnel_width = 5 # BUILDING MATERIALS air = "air" wall = "default:glass" floor = "default:stone" torch = "default:torch" # ENGINEERING CALCULATIONS tunnel_length = x_max - x_min + 1 wall_z = ref_z - tunnel_width // 2 # x values for tunnel glass and air range_x = range(x_min, x_min + tunnel_length) # y and z values for tunnel glass (external)
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # BUILDING LOCATION # player's z coordinate used as reference point for all building ref_z = player_z # x value at start of stone path heading +x direction path_x_min = 105 # y value of stone in path floor_y = 9 # BUILDING SIZE # height of arch in number of blocks (external dimension) arch_height = 7 # width of arch in number of blocks (external dimension) arch_width = 5 # path length path_length = 16 # castle length (in x direction) castle_length = 9 # castle width (in z direction) castle_width = 5 # castle height excluding roof castle_height = 4 # BUILDING MATERIALS air = "air"
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # BUILDING LOCATION ref_z = player_z x_max = 93 x_min = 70 floor_y = 14 # BUILDING SIZE tunnel_height = 7 tunnel_width = 5 # BUILDING MATERIALS air = "air" wall = "default:glass" # ENGINEERING CALCULATIONS tunnel_length = x_max - x_min + 1 wall_z = ref_z - tunnel_width // 2 # x values for tunnel glass and air range_x = range(x_min, x_min + tunnel_length) # y and z values for glass on exterior of tunnel range_y_ext = range(floor_y, floor_y + tunnel_height) range_z_ext = range(wall_z, wall_z + tunnel_width) # y and z values for air in the interior of tunnel
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # BUILDING LOCATION # player's z coordinate used as reference point for all building ref_z = player_z # x value at start of stone path heading +x direction path_x_min = 105 # x value at start of castle castle_x_min = 121 # y value of floor of castle floor_y = 9 # BUILDING SIZE # castle length (in x direction) castle_length = 9 # castle width (in z direction) castle_width = 5 # castle height excluding roof including floor castle_height = 5 # BUILDING MATERIALS air = "air" castle = "default:stone" # player looking in x direction to look through this window window_x = {"name": "xpanes:bar_flat", "direction": "+x"} # player looking in z direction to look through this window
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # position of centre of square cx = 100 cy = 32 z = player_z # array of node types which we will alternate through colour0 = "wool:green" colour1 = "wool:blue" colours = [colour0, colour1] # calculate extents of square width = 9 height = 9 x1 = cx - width // 2 y1 = cy - height // 2 x2 = x1 + width y2 = y1 + height # loop through all positions in square for y in range(y1, y2): for x in range(x1, x2): colour = colours[(y + x) % 2] b.build(x, y, z, colour) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc:
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # position of centre of diamond cx = 100 cy = 32 z = player_z # array of node types which we will alternate through colours = ["wool:white", "wool:orange"] # calculate extents of diamond width = 21 height = 21 x1 = cx - width // 2 y1 = cy - height // 2 x2 = x1 + width y2 = y1 + height # clear area first with air b.build(range(x1, x2), range(y1, y2), z, "air") # build diamond for y in range(y1, y2): # calculate x range which will give diamond shape xlo = x1 + abs(y - cy) xhi = x2 - abs(y - cy)
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() ref_z = player_z wool = "wool:red" glass = "default:glass" b.build(100, 13, ref_z - 1, glass) b.build(100, 14, ref_z - 1, glass) b.build(100, 15, ref_z - 1, glass) b.build(100, 13, ref_z, glass) b.build(100, 14, ref_z, wool) b.build(100, 15, ref_z, glass) b.build(100, 13, ref_z + 1, glass) b.build(100, 14, ref_z + 1, glass) b.build(100, 15, ref_z + 1, glass) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() ref_x = 101 ref_y = 14 ref_z = player_z glass = "default:obsidian_glass" for y in (ref_y - 1, ref_y, ref_y + 1): for z in (ref_z - 1, ref_z, ref_z + 1): b.build(ref_x, y, z, glass) print("y", y, "z", z) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # BUILDING LOCATION # player's z coordinate used as reference point for all building ref_z = player_z # x value at start of stone path heading +x direction path_x_min = 105 # y value of stone in path floor_y = 9 # BUILDING SIZE # height of arch in number of blocks (external dimension) arch_height = 7 # width of arch in number of blocks (external dimension) arch_width = 5 # BUILDING MATERIALS air = "air" wall = "default:glass" # ENGINEERING CALCULATIONS # z value of side of arch (where wall_z < player_z) wall_z = ref_z - arch_width // 2 # x value for arch location range_x_arch = path_x_min # external dimensions of arch
from ircbuilder import open_irc from ircbuilder.building import Building from math import sqrt from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # LOCATION ref_z = player_z pole_x = 122 pole_y = 15 flag_y = 22 # SIZE flag_height = 13 flag_length = 21 # SHAPE def rectangle_flag(global_x, global_y): local_x = global_x - pole_x local_y = global_y - flag_y if local_x < 0 or local_x >= flag_length: return False if local_y < 0 or local_y >= flag_height: return False return True
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() ref_x = 100 ref_y = 14 ref_z = player_z wool = "wool:yellow" glass = "default:glass" seq_x = (ref_x - 1, ref_x, ref_x + 1) # or (99, 100, 101) seq_y = (ref_y - 1, ref_y, ref_y + 1) # or (13, 14, 15) seq_z = (ref_z - 1, ref_z, ref_z + 1) b.build(seq_x, seq_y, seq_z, glass) b.build(ref_x, ref_y, ref_z, wool) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # Location of end points of sloping section of tunnel (centre of floor) x1 = 69 y1 = 14 x2 = 9 y2 = -46 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
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # 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 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.build(x1 - i, y1 - i, z - 1, stair_up_x) # Add power rail b.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
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel, player_z b = Building() # player_z has been imported from the configuration file you created in first task ref_z = player_z glass = "default:obsidian_glass" for y in (13, 14, 15): b.build(99, y, ref_z - 1, glass) b.build(99, y, ref_z, glass) b.build(99, y, ref_z + 1, glass) print(y) with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt
from ircbuilder import open_irc from ircbuilder.building import Building from minetest_irc import ircserver, mtuser, mtuserpass, mtbotnick, channel b = Building() b.build(100, 14, 20, "wool:green") with open_irc(ircserver, mtuser, mtuserpass, mtbotnick, channel) as mc: b.send(mc) # © Copyright 2018-2021 Triptera Pty Ltd - https://pythonator.com - See LICENSE.txt