From 79d96e9ea03394daf419e6f6f5236ffcacb5c619 Mon Sep 17 00:00:00 2001 From: kno10 Date: Sat, 20 Jul 2024 02:10:25 +0200 Subject: [PATCH] add MCLA schematics --- mods/MAPGEN/mcl_villages/buildings.lua | 110 ++----- mods/MAPGEN/mcl_villages/const.lua | 138 ++++++-- mods/MAPGEN/mcl_villages/foundation.lua | 298 +++++++----------- mods/MAPGEN/mcl_villages/init.lua | 4 +- .../schematics/new_villages/belltower.mts | Bin 0 -> 472 bytes .../schematics/new_villages/blacksmith.mts | Bin 0 -> 770 bytes .../schematics/new_villages/butcher.mts | Bin 0 -> 968 bytes .../schematics/new_villages/cartographer.mts | Bin 0 -> 792 bytes .../schematics/new_villages/chapel.mts | Bin 0 -> 635 bytes .../schematics/new_villages/church.mts | Bin 0 -> 1187 bytes .../schematics/new_villages/farm.mts | Bin 0 -> 404 bytes .../schematics/new_villages/farm_large_1.mts | Bin 0 -> 670 bytes .../schematics/new_villages/farm_small_1.mts | Bin 0 -> 520 bytes .../schematics/new_villages/farm_small_2.mts | Bin 0 -> 487 bytes .../schematics/new_villages/fishery.mts | Bin 0 -> 731 bytes .../schematics/new_villages/fletcher.mts | Bin 0 -> 604 bytes .../schematics/new_villages/house_1_bed.mts | Bin 0 -> 710 bytes .../schematics/new_villages/house_2_bed.mts | Bin 0 -> 826 bytes .../schematics/new_villages/house_3_bed.mts | Bin 0 -> 1086 bytes .../schematics/new_villages/house_4_bed.mts | Bin 0 -> 1227 bytes .../schematics/new_villages/lamp_1.mts | Bin 0 -> 84 bytes .../schematics/new_villages/lamp_2.mts | Bin 0 -> 122 bytes .../schematics/new_villages/lamp_3.mts | Bin 0 -> 135 bytes .../schematics/new_villages/lamp_4.mts | Bin 0 -> 97 bytes .../schematics/new_villages/lamp_5.mts | Bin 0 -> 73 bytes .../schematics/new_villages/lamp_6.mts | Bin 0 -> 75 bytes .../new_villages/leather_worker.mts | Bin 0 -> 578 bytes .../schematics/new_villages/library.mts | Bin 0 -> 1110 bytes .../schematics/new_villages/mason.mts | Bin 0 -> 586 bytes .../schematics/new_villages/mill.mts | Bin 0 -> 573 bytes .../schematics/new_villages/toolsmith.mts | Bin 0 -> 907 bytes .../schematics/new_villages/weaponsmith.mts | Bin 0 -> 913 bytes .../schematics/new_villages/well.mts | Bin 0 -> 409 bytes mods/MAPGEN/mcl_villages/utils.lua | 16 +- 34 files changed, 280 insertions(+), 286 deletions(-) create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/belltower.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/blacksmith.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/butcher.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/cartographer.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/chapel.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/church.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/farm.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/farm_large_1.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_1.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_2.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/fishery.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/fletcher.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/house_1_bed.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/house_2_bed.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/house_3_bed.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/house_4_bed.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_1.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_2.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_3.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_4.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_5.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_6.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/leather_worker.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/library.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/mason.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/mill.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/toolsmith.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/weaponsmith.mts create mode 100644 mods/MAPGEN/mcl_villages/schematics/new_villages/well.mts diff --git a/mods/MAPGEN/mcl_villages/buildings.lua b/mods/MAPGEN/mcl_villages/buildings.lua index e2e9a5057..b31df2f27 100644 --- a/mods/MAPGEN/mcl_villages/buildings.lua +++ b/mods/MAPGEN/mcl_villages/buildings.lua @@ -1,59 +1,3 @@ ---[[ -------------------------------------------------------------------------------- --- build schematic, replace material, rotation -------------------------------------------------------------------------------- -function mcl_villages.build_schematic(vm, data, va, pos, building, replace_wall, name) - -- get building node material for better integration to surrounding - local platform_material = mcl_vars.get_node(pos) - if not platform_material or (platform_material.name == "air" or platform_material.name == "ignore") then - return - end - platform_material = platform_material.name - -- pick random material - local material = wallmaterial[math.random(1,#wallmaterial)] - -- schematic conversion to lua - local schem_lua = minetest.serialize_schematic(building, - "lua", - {lua_use_comments = false, lua_num_indent_spaces = 0}).." return schematic" - -- replace material - if replace_wall == "y" then - schem_lua = schem_lua:gsub("mcl_core:cobble", material) - end - schem_lua = schem_lua:gsub("mcl_core:dirt_with_grass", - platform_material) - --- Disable special junglewood for now. - -- special material for spawning npcs - -- schem_lua = schem_lua:gsub("mcl_core:junglewood", - -- "settlements:junglewood") --- - - -- format schematic string - local schematic = loadstring(schem_lua)() - -- build foundation for the building an make room above - local width = schematic["size"]["x"] - local depth = schematic["size"]["z"] - local height = schematic["size"]["y"] - local possible_rotations = {"0", "90", "180", "270"} - local rotation = possible_rotations[ math.random( #possible_rotations ) ] - mcl_villages.foundation( - pos, - width, - depth, - height, - rotation) - vm:set_data(data) - -- place schematic - - minetest.place_schematic_on_vmanip( - vm, - pos, - schematic, - rotation, - nil, - true) - vm:write_to_map(true) -end]] ------------------------------------------------------------------------------- -- initialize settlement_info ------------------------------------------------------------------------------- @@ -76,33 +20,33 @@ end ------------------------------------------------------------------------------- -- check ground for a single building ------------------------------------------------------------------------------- -local function try_place_building(pos_surface, building_all_info, rotation, settlement_info, pr) - local fwidth, fdepth = building_all_info["hwidth"], building_all_info["hdepth"] +local function try_place_building(minp, maxp, pos_surface, building_all_info, rotation, settlement_info, pr) + local fwidth, fdepth = building_all_info["hwidth"] or 5, building_all_info["hdepth"] or 5 if rotation == "90" or rotation == "270" then fwidth, fdepth = fdepth, fwidth end - local fheight = building_all_info["hheight"] + local fheight = building_all_info["hheight"] or 5 -- use building centers for better placement pos_surface.x = pos_surface.x - math.ceil(fwidth / 2) pos_surface.z = pos_surface.z - math.ceil(fdepth / 2) + -- ensure we have 3 space for terraforming + if pos_surface.x - 3 < minp.x or pos_surface.z + 3 < minp.z or pos_surface.x + fwidth + 3 > maxp.x or pos_surface.z + fheight + 3 > maxp.z then return nil end -- to find the y position, also check the corners local ys = {pos_surface.y} local pos_c - pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x-1, pos_surface.y+fheight, pos_surface.z-1)) + pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x, pos_surface.y+fheight, pos_surface.z)) if pos_c then table.insert(ys, pos_c.y) end - pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x+fwidth+2, pos_surface.y+fheight, pos_surface.z-1)) + pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x+fwidth-1, pos_surface.y+fheight, pos_surface.z)) if pos_c then table.insert(ys, pos_c.y) end - pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x-1, pos_surface.y+fheight, pos_surface.z+fdepth+2)) + pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x, pos_surface.y+fheight, pos_surface.z+fdepth-1)) if pos_c then table.insert(ys, pos_c.y) end - pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x+fwidth+2, pos_surface.y+fheight, pos_surface.z+fdepth+2)) + pos_c = mcl_villages.find_surface_down(vector.new(pos_surface.x+fwidth-1, pos_surface.y+fheight, pos_surface.z+fdepth-1)) if pos_c then table.insert(ys, pos_c.y) end table.sort(ys) -- well supported base, not too uneven? if #ys < 5 or ys[#ys]-ys[1] > fheight + 3 then return nil end pos_surface.y = ys[math.ceil(#ys/2)] -- check distance to other buildings - if mcl_villages.check_distance(settlement_info, pos_surface, building_all_info["hsize"]) then - return pos_surface - end - return nil + if not mcl_villages.check_distance(settlement_info, pos_surface, math.max(fheight, fdepth)) then return nil end + return pos_surface end ------------------------------------------------------------------------------- -- fill settlement_info @@ -132,7 +76,7 @@ function mcl_villages.create_site_plan(minp, maxp, pr) -- already enough buildings of that type? if count_buildings[building_all_info["name"]] < building_all_info["max_num"]*number_of_buildings then local rotation = possible_rotations[pr:next(1, #possible_rotations)] - local pos = try_place_building(pos_surface, building_all_info, rotation, settlement_info, pr) + local pos = try_place_building(minp, maxp, pos_surface, building_all_info, rotation, settlement_info, pr) if pos then if #settlement_info == 0 then -- town bell center_surface, y = pos, pos.y + max_height_difference @@ -148,7 +92,7 @@ function mcl_villages.create_site_plan(minp, maxp, pr) table.insert(settlement_info, { pos = pos, name = building_all_info["name"], - hsize = building_all_info["hsize"], + hsize = math.max(building_all_info["hwidth"], building_all_info["hdepth"]), -- ,building_all_info["hsize"], rotat = rotation, surface_mat = surface_material }) @@ -170,12 +114,12 @@ function mcl_villages.create_site_plan(minp, maxp, pr) if r > 35 then break end -- avoid touching neighboring blocks end mcl_villages.debug("really ".. number_built) - if number_built <= 8 then + if number_built < 8 then minetest.log("action", "Bad village location, could only place "..number_built.." buildings.") return end minetest.log("action", "Village completed at " .. minetest.pos_to_string(center)) - minetest.log("Village completed at " .. minetest.pos_to_string(center)) -- for debugging only + --minetest.log("Village completed at " .. minetest.pos_to_string(center)) -- for debugging only return settlement_info end ------------------------------------------------------------------------------- @@ -275,18 +219,28 @@ function mcl_villages.place_schematics(settlement_info, pr) local schem_lua = building_all_info["schem_lua"] if not schem_lua then schem_lua = minetest.serialize_schematic(building_all_info["mts"], "lua", { lua_use_comments = false, lua_num_indent_spaces = 0 }) .. " return schematic" + -- MCLA node names to VL for import + for _, sub in pairs(mcl_villages.mcla_to_vl) do + schem_lua = schem_lua:gsub(sub[1], sub[2]) + end + local schematic = loadstring(schem_lua)() + if schematic.size["x"] ~= building_all_info["hwidth"] or schematic.size["y"] ~= building_all_info["hheight"] or schematic.size["z"] ~= building_all_info["hdepth"] then + minetest.log(building_all_info["name"].." width "..schematic.size["x"].." height "..schematic.size["y"].." depth "..schematic.size["z"]) + end building_all_info["schem_lua"] = schem_lua end schem_lua = schem_lua:gsub('"mcl_core:dirt"', '"'..platform_material..'"') schem_lua = schem_lua:gsub('"mcl_core:dirt_with_grass"', '"'..surface_material..'"') local schematic = loadstring(mcl_villages.substitute_materials(pos, schem_lua, pr))() - local is_belltower = building_all_info["name"] == "belltower" - -- already built the foundation for the building and made room above local sx, sy, sz = schematic.size.x, schematic.size.y, schematic.size.z + if rotation == "90" or rotation == "270" then sx, sz = sz, sx end local p2 = vector.new(pos.x+sx-1,pos.y+sy-1,pos.z+sz-1) - lvm:read_from_map(pos, p2) + lvm:read_from_map(vector.new(pos.x-3, pos.y-40, pos.z-3), vector.new(pos.x+sx+3, pos.y+sy+40, pos.z+sz+3)) -- safety margins for foundation + lvm:get_data() + -- TODO: make configurable as in MCLA + mcl_villages.foundation(lvm, pos, sx, sy, sz, surface_material, pr) minetest.place_schematic_on_vmanip( lvm, pos, @@ -297,14 +251,12 @@ function mcl_villages.place_schematics(settlement_info, pr) { place_center_x = false, place_center_y = false, place_center_z = false } ) lvm:write_to_map(true) -- FIXME: postpone - if rotation == "90" or rotation == "270" then sx, sz = sz, sx end init_nodes(pos, p2, schematic.size, rotation, pr) - if is_belltower then + if building_all_info["name"] == "belltower" then spawn_iron_golem(pos) - else - spawn_villagers(pos,p2) - fix_village_water(pos,p2) end + spawn_villagers(pos,p2) + fix_village_water(pos,p2) end end diff --git a/mods/MAPGEN/mcl_villages/const.lua b/mods/MAPGEN/mcl_villages/const.lua index 30ee9508f..2c443e54d 100644 --- a/mods/MAPGEN/mcl_villages/const.lua +++ b/mods/MAPGEN/mcl_villages/const.lua @@ -59,18 +59,47 @@ schem_path = mcl_villages.modpath.."/schematics/" local basic_pseudobiome_villages = minetest.settings:get_bool("basic_pseudobiome_villages", true) mcl_villages.schematic_table = { - {name = "belltower", mts = schem_path.."belltower.mts", hwidth = 5, hdepth = 5, hheight = 9, hsize = 14, max_num = 0.0001 , rplc = basic_pseudobiome_villages, yadjust = 1 }, - {name = "large_house", mts = schem_path.."large_house.mts", hwidth = 12, hdepth = 12, hheight = 9, hsize = 14, max_num = 0.08 , rplc = basic_pseudobiome_villages }, - {name = "blacksmith", mts = schem_path.."blacksmith.mts", hwidth = 8, hdepth = 11, hheight = 13, hsize = 13, max_num = 0.055 , rplc = basic_pseudobiome_villages }, - {name = "butcher", mts = schem_path.."butcher.mts", hwidth = 12, hdepth = 8, hheight = 10, hsize = 14, max_num = 0.03 , rplc = basic_pseudobiome_villages }, - {name = "church", mts = schem_path.."church.mts", hwidth = 13, hdepth = 13, hheight = 14, hsize = 15, max_num = 0.04 , rplc = basic_pseudobiome_villages }, - {name = "farm", mts = schem_path.."farm.mts", hwidth = 9, hdepth = 7, hheight = 13, hsize = 13, max_num = 0.1 , rplc = basic_pseudobiome_villages, yadjust = 1 }, - {name = "lamp", mts = schem_path.."lamp.mts", hwidth = 3, hdepth = 4, hheight = 13, hsize = 10, max_num = 0.1 , rplc = false }, - {name = "library", mts = schem_path.."library.mts", hwidth = 12, hdepth = 12, hheight = 8, hsize = 13, max_num = 0.04 , rplc = basic_pseudobiome_villages }, - {name = "medium_house", mts = schem_path.."medium_house.mts", hwidth = 9, hdepth = 12, hheight = 8, hsize = 14, max_num = 0.08 , rplc = basic_pseudobiome_villages }, - {name = "small_house", mts = schem_path.."small_house.mts", hwidth = 9, hdepth = 8, hheight = 8, hsize = 13, max_num = 0.7 , rplc = basic_pseudobiome_villages }, - {name = "tavern", mts = schem_path.."tavern.mts", hwidth = 12, hdepth = 10, hheight = 10, hsize = 13, max_num = 0.050, rplc = basic_pseudobiome_villages }, - {name = "well", mts = schem_path.."well.mts", hwidth = 6, hdepth = 8, hheight = 6, hsize = 10, max_num = 0.045, rplc = basic_pseudobiome_villages }, + {name = "belltower", mts = schem_path.."new_villages/belltower.mts", hwidth = 9, hdepth = 9, hheight = 7, hsize = 12, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1, yadjust = 1 }, + {name = "old_belltower", mts = schem_path.."belltower.mts", hwidth = 5, hdepth = 5, hheight = 6, hsize = 8, max_num = 0, rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "large_house", mts = schem_path.."large_house.mts", hwidth = 12, hdepth = 12, hheight = 10, hsize = 18, max_num = 0.08 , rplc = basic_pseudobiome_villages }, + {name = "blacksmith", mts = schem_path.."blacksmith.mts", hwidth = 8, hdepth = 11, hheight = 8, hsize = 15, max_num = 0.01 , rplc = basic_pseudobiome_villages }, + {name = "new_blacksmith", mts = schem_path.."new_villages/blacksmith.mts", hwidth = 9, hdepth = 11, hheight = 8, hsize = 15, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "weaponsmith", mts = schem_path.."new_villages/weaponsmith.mts", hwidth = 11, hdepth = 9, hheight = 6, hsize = 15, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "toolsmith", mts = schem_path.."new_villages/toolsmith.mts", hwidth = 9, hdepth = 11, hheight = 6, hsize = 15, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "tannery", mts = schem_path.."new_villages/leather_worker.mts", hwidth = 8, hdepth = 8, hheight = 7, hsize = 12, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "butcher", mts = schem_path.."butcher.mts", hwidth = 12, hdepth = 8, hheight = 10, hsize = 15, max_num = 0.01 , rplc = basic_pseudobiome_villages }, + {name = "church", mts = schem_path.."church.mts", hwidth = 13, hdepth = 14, hheight = 15, hsize = 20, max_num = 0.01 , rplc = basic_pseudobiome_villages }, + {name = "newchurch", mts = schem_path.."new_villages/church.mts", hwidth = 14, hdepth = 16, hheight = 13, hsize = 22, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "chapel", mts = schem_path.."new_villages/chapel.mts", hwidth = 9, hdepth = 10, hheight = 6, hsize = 14, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "farm", mts = schem_path.."farm.mts", hwidth = 9, hdepth = 7, hheight = 8, hsize = 12, max_num = 0.1 , rplc = basic_pseudobiome_villages, yadjust = 0 }, + {name = "lamp", mts = schem_path.."lamp.mts", hwidth = 3, hdepth = 4, hheight = 6, hsize = 6, max_num = 0.001 , rplc = false }, + {name = "lamp_1", mts = schem_path.."new_villages/lamp_1.mts", hwidth = 1, hdepth = 1, hheight = 4, hsize = 2, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "lamp_2", mts = schem_path.."new_villages/lamp_2.mts", hwidth = 1, hdepth = 2, hheight = 6, hsize = 3, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "lamp_3", mts = schem_path.."new_villages/lamp_3.mts", hwidth = 3, hdepth = 3, hheight = 4, hsize = 5, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "lamp_4", mts = schem_path.."new_villages/lamp_4.mts", hwidth = 1, hdepth = 2, hheight = 5, hsize = 3, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "lamp_5", mts = schem_path.."new_villages/lamp_5.mts", hwidth = 1, hdepth = 1, hheight = 2, hsize = 2, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "lamp_6", mts = schem_path.."new_villages/lamp_6.mts", hwidth = 1, hdepth = 1, hheight = 3, hsize = 2, max_num = 0.001 , rplc = false, yadjust = 1 }, + {name = "library", mts = schem_path.."library.mts", hwidth = 12, hdepth = 12, hheight = 9, hsize = 18, max_num = 0.01 , rplc = basic_pseudobiome_villages }, + {name = "newlibrary", mts = schem_path.."new_villages/library.mts", hwidth = 14, hdepth = 14, hheight = 7, hsize = 21, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "medium_house", mts = schem_path.."medium_house.mts", hwidth = 9, hdepth = 12, hheight = 9, hsize = 16, max_num = 0.08 , rplc = basic_pseudobiome_villages }, + {name = "small_house", mts = schem_path.."small_house.mts", hwidth = 9, hdepth = 8, hheight = 9, hsize = 13, max_num = 0.3 , rplc = basic_pseudobiome_villages }, + {name = "house_1_bed", mts = schem_path.."new_villages/house_1_bed.mts", hwidth = 9, hdepth = 8, hheight = 7, hsize = 13, max_num = 0.3 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "house_2_bed", mts = schem_path.."new_villages/house_2_bed.mts", hwidth = 11, hdepth = 8, hheight = 7, hsize = 15, max_num = 0.2 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "house_3_bed", mts = schem_path.."new_villages/house_3_bed.mts", hwidth = 11, hdepth = 13, hheight = 9, hsize = 18, max_num = 0.1 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "house_4_bed", mts = schem_path.."new_villages/house_4_bed.mts", hwidth = 11, hdepth = 13, hheight = 10, hsize = 18, max_num = 0.1 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "mason", mts = schem_path.."new_villages/mason.mts", hwidth = 8, hdepth = 8, hheight = 7, hsize = 12, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "mill", mts = schem_path.."new_villages/mill.mts", hwidth = 8, hdepth = 8, hheight = 7, hsize = 12, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "cartographer", mts = schem_path.."new_villages/cartographer.mts", hwidth = 9, hdepth = 12, hheight = 6, hsize = 16, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 2 }, + {name = "fletcher", mts = schem_path.."new_villages/fletcher.mts", hwidth = 8, hdepth = 8, hheight = 7, hsize = 12, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "new_butcher", mts = schem_path.."new_villages/butcher.mts", hwidth = 8, hdepth = 14, hheight = 9, hsize = 17, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust = 2 }, + {name = "fish_farm", mts = schem_path.."new_villages/fishery.mts", hwidth = 10, hdepth = 7, hheight = 9, hsize = 13, max_num = 0.01 , rplc = basic_pseudobiome_villages, yadjust=-2 }, + {name = "tavern", mts = schem_path.."tavern.mts", hwidth = 12, hdepth = 10, hheight = 13, hsize = 17, max_num = 0.050, rplc = basic_pseudobiome_villages }, + {name = "well", mts = schem_path.."well.mts", hwidth = 6, hdepth = 8, hheight = 7, hsize = 11, max_num = 0.01, rplc = basic_pseudobiome_villages }, + {name = "new_well", mts = schem_path.."new_villages/well.mts", hwidth = 6, hdepth = 6, hheight = 8, hsize = 9, max_num = 0.01, rplc = basic_pseudobiome_villages, yadjust=-1 }, + {name = "new_farm", mts = schem_path.."new_villages/farm.mts", hwidth=10, hdepth=9, hheight=6, hsize=14, max_num = 0.1, rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "farm_small", mts = schem_path.."new_villages/farm_small_1.mts", hwidth=10, hdepth=9, hheight=6, hsize=14, max_num = 0.1, rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "farm_small2", mts = schem_path.."new_villages/farm_small_2.mts", hwidth=9, hdepth=9, hheight=3, hsize=14, max_num = 0.1, rplc = basic_pseudobiome_villages, yadjust = 1 }, + {name = "farm_large", mts = schem_path.."new_villages/farm_large_1.mts", hwidth=13, hdepth=13, hheight=4, hsize=19, max_num = 0.1, rplc = basic_pseudobiome_villages, yadjust = 1 }, } -- @@ -127,16 +156,68 @@ mcl_villages.biome_map = { CherryGrove = "cherry", - -- no change - --FlowerForest = "oak", - --Forest = "oak", - --MushroomIsland = "", - --Plains = "oak", - --StoneBeach = "", - --SunflowerPlains = "oak", - --Swampland = "oak", + -- no change, but try to convert MCLA material + FlowerForest = "oak", + Forest = "oak", + MushroomIsland = "oak", + Plains = "oak", + StoneBeach = "oak", + SunflowerPlains = "oak", + Swampland = "oak", } +mcl_villages.vl_to_mcla = { + { '"mcl_core:tree"', '"mcl_trees:tree_oak"'}, + { '"mcl_core:wood"', '"mcl_trees:wood_oak"'}, + { '"mcl_fences:fence', '"mcl_fences:oak_fence'}, + { '"mcl_stairs:stair_wood"', '"mcl_stairs:stair_oak"'}, + { '"mcl_stairs:stair_wood_', '"mcl_stairs:stair_oak_'}, + { '"mcl_stairs:slab_wood"', '"mcl_stairs:slab_oak"'}, + { '"mcl_stairs:slab_wood_', '"mcl_stairs:slab_oak_'}, + { '"mcl_doors:wooden_door_', '"mcl_doors:door_oak_'}, + { '"mcl_doors:trapdoor_', '"mcl_doors:trapdoor_oak_'}, + { '"xpanes:bar', '"mcl_panes:bar' }, + { '"xpanes:pane', '"mcl_panes:pane' }, + { '"mcl_itemframes:item_frame"', '"mcl_itemframes:frame"' }, + { '"mesecons_pressureplates:pressure_plate_wood_', '"mesecons_pressureplates:pressure_plate_oak_'}, + -- tree types + { '"mcl_core:([a-z]*)tree"', '"mcl_trees:tree_%1"' }, + { '"mcl_core:([a-z]*)wood"', '"mcl_trees:wood_%1"' }, + { '"mcl_stairs:stair_([a-z]*)tree"', '"mcl_stairs:stair_%1"' }, +} +mcl_villages.mcla_to_vl = { + -- oneway + { '"mcl_villages:no_paths"', '"air"'}, -- TODO: support these + { '"mcl_villages:path_endpoint"', '"air"'}, -- TODO: support these + { '"mcl_villages:crop_root', '"mcl_farming:potato'}, -- TODO: support biome specific farming + { '"mcl_villages:crop_grain', '"mcl_farming:wheat'}, -- TODO: support biome specific farming + { '"mcl_villages:crop_gourd', '"mcl_farming:pumpkin'}, -- TODO: support biome specific farming + { '"mcl_villages:crop_flower', '"mcl_farming:sweet_berry_bush'}, -- TODO: support biome specific farming + -- bidirectional + { '"mcl_trees:tree_oak"', '"mcl_core:tree"'}, + { '"mcl_trees:wood_oak"', '"mcl_core:wood"'}, + { '"mcl_fences:oak_fence', '"mcl_fences:fence'}, + { '"mcl_stairs:stair_oak"', '"mcl_stairs:stair_wood"'}, + { '"mcl_stairs:stair_oak_bark', '"mcl_stairs:stair_tree_bark'}, + { '"mcl_stairs:stair_oak_', '"mcl_stairs:stair_wood_'}, + { '"mcl_stairs:slab_oak"', '"mcl_stairs:slab_wood"'}, + { '"mcl_stairs:slab_oak_', '"mcl_stairs:slab_wood_'}, + { '"mcl_doors:door_oak_', '"mcl_doors:wooden_door_'}, + { '"mcl_doors:trapdoor_oak_', '"mcl_doors:trapdoor_'}, + { '"mcl_panes:bar', '"xpanes:bar' }, + { '"mcl_panes:pane', '"xpanes:pane' }, + { '"mcl_itemframes:frame"', '"mcl_itemframes:item_frame"' }, + { '"mesecons_pressureplates:pressure_plate_oak_', '"mesecons_pressureplates:pressure_plate_wood_'}, + -- tree types + { '"mcl_trees:tree_([a-z]*)"', '"mcl_core:%1tree"' }, + { '"mcl_trees:wood_([a-z]*)"', '"mcl_core:%1wood"' }, + { '"mcl_stairs:stair_birch(["_])', '"mcl_stairs:stair_birchwood%1' }, + { '"mcl_stairs:stair_spruce(["_])', '"mcl_stairs:stair_sprucewood%1' }, + { '"mcl_stairs:stair_dark(["_])', '"mcl_stairs:stair_darkwood%1' }, + { '"mcl_stairs:stair_jungle(["_])', '"mcl_stairs:stair_junglewood%1' }, + { '"mcl_stairs:stair_acacia(["_])', '"mcl_stairs:stair_acaciawood%1' }, + { '"mcl_stairs:stair_bamboo(["_])', '"mcl_stairs:stair_bamboowood%1' }, +} mcl_villages.material_substitions = { desert = { { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_sandstonesmooth%1"' }, @@ -168,6 +249,7 @@ mcl_villages.material_substitions = { { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_sandstonesmooth%1"' }, }, spruce = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_sprucewood%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -179,8 +261,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_spruce" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:spruce_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_spruce%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, birch = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_birchwood%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -192,8 +276,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_birch" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:birch_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_birch%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, acacia = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_acaciawood%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -205,8 +291,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_acacia" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:acacia_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_acacia%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, dark_oak = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_darkwood%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -218,8 +306,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_dark_oak" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:dark_oak_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_dark_oak%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, jungle = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_junglewood%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -231,8 +321,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_jungle" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:jungle_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_jungle%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, bamboo = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_bamboo_block%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -249,8 +341,10 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_bamboo" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:bamboo_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_bamboo%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, cherry = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)"', '"%1_oak"'}, -- VL to MCLA { '"mcl_stairs:slab_oak([^"]*)"', '"mcl_stairs:slab_cherry_blossom%1"' }, { '"mesecons_pressureplates:pressure_plate_oak_([^"]+)"', @@ -262,5 +356,9 @@ mcl_villages.material_substitions = { { "mcl_trees:wood_oak", "mcl_trees:wood_cherry_blossom" }, { '"mcl_fences:oak_fence([^"]*)"', '"mcl_fences:cherry_blossom_fence%1"' }, { '"mcl_stairs:stair_oak([^"]*)"', '"mcl_stairs:stair_cherry_blossom%1"' }, + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL + }, + oak = { + { '"(mcl_core:wood|mcl_core:tree|mcl_stairs:stair_wood|mcl_fences:fence)_oak"', '"%1"'}, -- MCLA to VL }, } diff --git a/mods/MAPGEN/mcl_villages/foundation.lua b/mods/MAPGEN/mcl_villages/foundation.lua index cf9f9f403..a01b22b9c 100644 --- a/mods/MAPGEN/mcl_villages/foundation.lua +++ b/mods/MAPGEN/mcl_villages/foundation.lua @@ -12,6 +12,12 @@ local function is_solid(node) local ndef = minetest.registered_nodes[node.name] return ndef and ndef.walkable end +local function make_solid(lvm, cp, with, except) + local cur = lvm:get_node_at(cp) + if not is_solid(cur) or (except and cur.name == except) then + lvm:set_node_at(cp, {name=with}) + end +end local function excavate(lvm,xi,yi,zi,pr) local pos, n, c = vector.new(xi,yi,zi), nil, 0 local node = lvm:get_node_at(pos) @@ -28,7 +34,7 @@ local function excavate(lvm,xi,yi,zi,pr) -- try to completely remove trees overhead if not string.find(node.name, "leaf") and not string.find(node.name, "tree") then -- stop randomly depending on fill, to narrow down the caves - if pr:next(0,905) > c * 100 then return false end + if pr:next(0,31)^2 > c * 100 then return false end end lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) return true -- modified @@ -51,7 +57,7 @@ local function grow_foundation(lvm,xi,yi,zi,pr,surface_mat,platform_mat) end end -- stop randomly depending on fill, to narrow down the foundation - if pr:next(0,905) > c * 100 then return false end + if pr:next(0,31)^2 > c * 100 then return false end lvm:set_node_at(vector.new(xi, yi, zi),{name=platform_mat}) return true -- modified end @@ -59,7 +65,6 @@ end -- function clear space above baseplate ------------------------------------------------------------------------------- function mcl_villages.terraform(settlement_info, pr) - local fheight, fwidth, fdepth, schematic_data --local lvm, emin, emax = minetest.get_mapgen_object("voxelmanip") local lvm = VoxelManip() @@ -72,188 +77,117 @@ function mcl_villages.terraform(settlement_info, pr) end end local pos = settlement_info[i]["pos"] - if settlement_info[i]["rotat"] == "0" or settlement_info[i]["rotat"] == "180" then - fwidth, fdepth = schematic_data["hwidth"], schematic_data["hdepth"] - else - fwidth, fdepth = schematic_data["hdepth"], schematic_data["hwidth"] - end - fheight = schematic_data["hheight"] -- remove trees and leaves above - - -- use biome-specific materials + local fwidth, fheight, fdepth = schematic_data["hwidth"], schematic_data["hheight"], schematic_data["hdepth"] local surface_mat = settlement_info[i]["surface_mat"] - mcl_villages.debug("Surface material: " .. tostring(surface_mat)) - local platform_mat = foundation_materials[surface_mat] or "mcl_core:dirt" - mcl_villages.debug("Foundation material: " .. tostring(platform_mat)) - + if settlement_info[i]["rotat"] == "90" or settlement_info[i]["rotat"] == "270" then + fwidth, fdepth = fdepth, fwidth + end lvm:read_from_map(vector.new(pos.x-2, pos.y-20, pos.z-2), vector.new(pos.x+fwidth+2, pos.y+fheight+20, pos.z+fdepth+2)) - -- TODO: further optimize by using raw data arrays instead of set_node_at. But OK for a first draft. lvm:get_data() - -- excavate the needed volume, some headroom, and add a baseplate - local p2 = vector.new(pos) - for xi = pos.x,pos.x+fwidth-1 do - for zi = pos.z,pos.z+fdepth-1 do - lvm:set_node_at(vector.new(xi, pos.y+1, zi),{name="air"}) - -- pos.y+2 to pos.y+5 are filled larger below! - for yi = pos.y+6,pos.y+fheight do - lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) - end - local cp = vector.new(xi, pos.y, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - local cp = vector.new(xi, pos.y - 1, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) then - lvm:set_node_at(cp, {name=platform_mat}) - end - end - end - -- slightly widen the cave, to make easier to enter for mobs - for xi = pos.x-1,pos.x+fwidth do - for zi = pos.z-1,pos.z+fdepth do - for yi = pos.y+2,pos.y+5 do - lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) - end - end - end - -- some extra gaps - for xi = pos.x-2,pos.x+fwidth+1 do - for zi = pos.z-2,pos.z+fdepth+1 do - if pr:next(1,4) == 1 then - for yi = pos.y+3,pos.y+5 do - lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) - end - end - end - end - -- slightly widen the baseplate, to make easier to enter for mobs - for xi = pos.x,pos.x+fwidth-1 do - local cp = vector.new(xi, pos.y-1, pos.z) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) then - lvm:set_node_at(cp, {name=platform_mat}) - end - local cp = vector.new(xi, pos.y-1, pos.z-1) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - local cp = vector.new(xi, pos.y-1, pos.z+fdepth-1) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) then - lvm:set_node_at(cp, {name=platform_mat}) - end - local cp = vector.new(xi, pos.y-1, pos.z+fdepth) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - for zi = pos.z,pos.z+fdepth-1 do - local cp = vector.new(pos.x, pos.y-1, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) then - lvm:set_node_at(cp, {name=platform_mat}) - end - local cp = vector.new(pos.x-1, pos.y-1, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - local cp = vector.new(pos.x+fwidth-1, pos.y-1, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) then - lvm:set_node_at(cp, {name=platform_mat}) - end - local cp = vector.new(pos.x+fwidth, pos.y-1, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - -- make some additional steps, along both x sides - for xi = pos.x,pos.x+fwidth-1 do - local cp = vector.new(xi, pos.y-3, pos.z-1) - if is_solid(lvm:get_node_at(cp)) then - cp = vector.new(xi, pos.y-2, pos.z-1) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - cp.z = pos.z-2 - cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - local cp = vector.new(xi, pos.y-3, pos.z+fdepth) - if is_solid(lvm:get_node_at(cp)) then - cp = vector.new(xi, pos.y-2, pos.z+fdepth) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - cp.z = pos.z + fdepth + 1 - cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - end - -- make some additional steps, along both z sides - for zi = pos.z,pos.z+fdepth-1 do - local cp = vector.new(pos.x-1, pos.y-3, zi) - if is_solid(lvm:get_node_at(cp)) then - cp = vector.new(pos.x-1, pos.y-2, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - cp.x = pos.x-2 - cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - local cp = vector.new(pos.x+fwidth, pos.y-3, zi) - if is_solid(lvm:get_node_at(cp)) then - cp = vector.new(pos.x+fwidth, pos.y-2, zi) - local cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - cp.x = pos.x+fwidth+1 - cur = lvm:get_node_at(cp) - if not is_solid(cur) or cur.name == platform_mat then - lvm:set_node_at(cp, {name=surface_mat}) - end - end - end - -- cave some additional area overhead, try to make it interesting though - for yi = pos.y+3,pos.y+fheight*3 do - local active = false - for xi = pos.x-2,pos.x+fwidth+1 do - for zi = pos.z-2,pos.z+fdepth+1 do - if excavate(lvm,xi,yi,zi,pr) then - active = true - end - end - end - if not active and yi > pos.y+fheight+5 then break end - end - -- construct additional baseplate below, also try to make it interesting - for yi = pos.y-2,pos.y-20,-1 do - local active = false - for xi = pos.x-1,pos.x+fwidth do - for zi = pos.z-1,pos.z+fdepth do - if grow_foundation(lvm,xi,yi,zi,pr,surface_mat,platform_mat) then - active = true - end - end - end - if not active and yi < pos.y-5 then break end - end + mcl_villages.foundation(lvm, pos, fwidth, fheight, fdepth, surface_mat, pr) lvm:write_to_map(false) end end +function mcl_villages.foundation(lvm, pos, fwidth, fheight, fdepth, surface_mat, pr) + -- TODO: further optimize by using raw data arrays instead of set_node_at. But OK for a first draft. + local platform_mat = foundation_materials[surface_mat] or "mcl_core:dirt" + + -- excavate the needed volume, some headroom, and add a baseplate + local p2 = vector.new(pos) + for xi = pos.x,pos.x+fwidth-1 do + for zi = pos.z,pos.z+fdepth-1 do + lvm:set_node_at(vector.new(xi, pos.y+1, zi),{name="air"}) + -- pos.y+2 to pos.y+5 are filled larger below! + for yi = pos.y+6,pos.y+fheight do + lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) + end + make_solid(lvm, vector.new(xi, pos.y, zi), surface_mat, platform_mat) + make_solid(lvm, vector.new(xi, pos.y - 1, zi), platform_mat) + end + end + -- slightly widen the cave, to make easier to enter for mobs + for xi = pos.x-1,pos.x+fwidth do + for zi = pos.z-1,pos.z+fdepth do + for yi = pos.y+2,pos.y+5 do + lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) + end + end + end + -- some extra gaps + for xi = pos.x-2,pos.x+fwidth+1 do + for zi = pos.z-2,pos.z+fdepth+1 do + if pr:next(1,4) == 1 then + for yi = pos.y+3,pos.y+5 do + lvm:set_node_at(vector.new(xi, yi, zi),{name="air"}) + end + end + end + end + -- slightly widen the baseplate, to make easier to enter for mobs + for xi = pos.x,pos.x+fwidth-1 do + make_solid(lvm, vector.new(xi, pos.y-1, pos.z-1), surface_mat, platform_mat) + make_solid(lvm, vector.new(xi, pos.y-1, pos.z), platform_mat) + make_solid(lvm, vector.new(xi, pos.y-1, pos.z+fdepth-1), platform_mat) + make_solid(lvm, vector.new(xi, pos.y-1, pos.z+fdepth), surface_mat, platform_mat) + end + for zi = pos.z,pos.z+fdepth-1 do + make_solid(lvm, vector.new(pos.x-1, pos.y-1, zi), surface_mat, platform_mat) + make_solid(lvm, vector.new(pos.x, pos.y-1, zi), platform_mat) + make_solid(lvm, vector.new(pos.x+fwidth-1, pos.y-1, zi), platform_mat) + make_solid(lvm, vector.new(pos.x+fwidth, pos.y-1, zi), surface_mat, platform_mat) + end + -- make some additional steps, along both x sides + for xi = pos.x,pos.x+fwidth-1 do + local cp = vector.new(xi, pos.y-3, pos.z-1) + if is_solid(lvm:get_node_at(cp)) then + cp = vector.new(xi, pos.y-2, pos.z-1) + make_solid(lvm, cp, surface_mat, platform_mat) + cp.z = pos.z-2 + make_solid(lvm, cp, surface_mat, platform_mat) + end + local cp = vector.new(xi, pos.y-3, pos.z+fdepth) + if is_solid(lvm:get_node_at(cp)) then + cp = vector.new(xi, pos.y-2, pos.z+fdepth) + make_solid(lvm, cp, surface_mat, platform_mat) + cp.z = pos.z + fdepth + 1 + make_solid(lvm, cp, surface_mat, platform_mat) + end + end + -- make some additional steps, along both z sides + for zi = pos.z,pos.z+fdepth-1 do + local cp = vector.new(pos.x-1, pos.y-3, zi) + if is_solid(lvm:get_node_at(cp)) then + cp = vector.new(pos.x-1, pos.y-2, zi) + make_solid(lvm, cp, surface_mat, platform_mat) + cp.x = pos.x-2 + make_solid(lvm, cp, surface_mat, platform_mat) + end + local cp = vector.new(pos.x+fwidth, pos.y-3, zi) + if is_solid(lvm:get_node_at(cp)) then + cp = vector.new(pos.x+fwidth, pos.y-2, zi) + make_solid(lvm, cp, surface_mat, platform_mat) + cp.x = pos.x+fwidth+1 + make_solid(lvm, cp, surface_mat, platform_mat) + end + end + -- cave some additional area overhead, try to make it interesting though + for yi = pos.y+3,pos.y+fheight*3 do + local active = false + for xi = pos.x-2,pos.x+fwidth+1 do + for zi = pos.z-2,pos.z+fdepth+1 do + if excavate(lvm,xi,yi,zi,pr) then active = true end + end + end + if not active and yi > pos.y+fheight+5 then break end + end + -- construct additional baseplate below, also try to make it interesting + for yi = pos.y-2,pos.y-20,-1 do + local active = false + for xi = pos.x-1,pos.x+fwidth do + for zi = pos.z-1,pos.z+fdepth do + if grow_foundation(lvm,xi,yi,zi,pr,surface_mat,platform_mat) then active = true end + end + end + if not active and yi < pos.y-5 then break end + end +end diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index 56d92df64..ee260a806 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -1,7 +1,7 @@ mcl_villages = {} mcl_villages.modpath = minetest.get_modpath(minetest.get_current_modname()) -local village_chance = tonumber(minetest.settings:get("mcl_villages_village_chance")) or 5 +local village_chance = tonumber(minetest.settings:get("mcl_villages_village_chance")) or 10 dofile(mcl_villages.modpath.."/const.lua") dofile(mcl_villages.modpath.."/utils.lua") @@ -38,7 +38,7 @@ local function build_a_settlement(minp, maxp, blockseed) local settlement_info = mcl_villages.create_site_plan(minp, maxp, pr) if not settlement_info then return end - mcl_villages.terraform(settlement_info, pr) + --mcl_villages.terraform(settlement_info, pr) mcl_villages.place_schematics(settlement_info, pr) mcl_villages.paths(settlement_info) mcl_villages.add_village(blockseed, settlement_info) diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/belltower.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/belltower.mts new file mode 100644 index 0000000000000000000000000000000000000000..1f1d4bcbdf5170fd7deff0bf9c99cca206191ea1 GIT binary patch literal 472 zcmeYb3HD`RVc=w7XW*=d00v$L(cI*m__EBLoW%6hVynFT_=3cejA8~U6k(89d}>}w zL4Ial2?KLtW)XuTNI`K4kXdX6rhuIMyws$k%;fC&{L+%tA_i$ZN*IJelF9i+sX*N@ zeGFnC!SckM9FUnX(Rc%hVwhz)iAnMKiP;R2SWHMxEGkP)VGu{Q8LB?MB)XTAI_JT+TArK!bS!|V@k(ilRG3V{%K>lV0o)&)YLnZHj z@BIB*&G+pLjg`U2yURZ|PCGrljjKau+tt{#h6h)_l<#s6sD8-$l5OetpqHkZD_u(G z&fE8*^8bl9g8bja?i$)AChVL3{r_A$u`lV4|L5E~ckkET+wW=)|NmS2`dVFR*wrPs w)4Tp+0^GdVjxDJMTU8)8Ip2~bC|RdG&YQhaeqeqJhr7)WtReo=A; z&|okfU!Itg!yp6_FG$P-iY6r%#i!*YmN1Be#9&5%OafX9wow*hV@`e%*sfx$jKrdp z)V$P`_~e|#N(OlheJPpwMVTe3@x{6M`6U?;M}S;VQfvjLfD#}_NP#rMy$$knd}>}w zL4Ial34;JgE-?=%TWkfU7-W#Gf%`B%CBGCDDqu$>_f%{$>~4-PtkczJZ-s_JCZM}-E$xIs7;brpX+}3UgXXinVx=Lesed&y0eElljhlU1)e!kEcL`v z|J>$ned2Ek8A_J_YaJUTl)RcK(z4 zhk_(@C!o xgSE+m%Z|Lf5L4Lld2bz$`SFazYt9x@>Mve(GapWu<-K%QAWg?JzT(FOT>wE=Ib{F< literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/butcher.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/butcher.mts new file mode 100644 index 0000000000000000000000000000000000000000..194135239733cf1bcc44ef8df2a9f85ef26941ae GIT binary patch literal 968 zcmeYb3HD`RVc=lkWZ4NFXgWFBzybKQSA^WDo?2mgE;DX8?u4G=l_OXG&&KNql)`Nk)8n zQDSj1gBXV5`0~V@90o~jM#rZomZUNWfwdH+0!=T^&rgX5+RPvg5-Ui|1B!vj_`JlD z(xOD5<8l&9kTsM5wShH&4S{G#N-Tn?lL8r1TmtlJu@#sCsf^DrElDkccokg^;??5Z z{Or^sD+tA)mz!Fgnw+0k9A8kBT3lROlv)6E1IS%aZakO|F*+>`VsK_jYHnIlB2cRp zn1VzD%(|S!B%rhM^HL$90*(PNKdC4)IXgMAs4O)FDROcWQ&NB~28V1)em>AMAQEh0 zQoJEn@e-i8IEL?`u?&`g7*tY}SO77sAT^Ic7KaXKkb#2}o|Hi8C_XhWr64~uucTtm z+v&W;O$Iz|m&IZP=lY1;U4J(|Uh2{fucxmIs?6`r`MW{2^4-=ZCLWK!g$yqg=J*Ko zsZZW}^Ndt*Wf9-`$Jftv|B0-e_T;9D+v!h7o<|;LkKppPk%|}N;_(g7h}&v&-|6JW zr9b(;$yl#@`22H)&ffo>?;;*;-1GUs;%#eFLJo<$pS)W8Zts@REss{)KC>*VxOJ*; z`GiWr4?CnDSBm&N?)s)_paY39(q0Re0CTA|G z%oE7lrl_ygbNl;CBdzaq7mNT47w52zAE#^)uLloloC#HZyXmM}>eLzBo5ACx<~DES^|YlAm6bSddW}Uy=y4-6|Pfgh3dj zFeyJjyVwd$W~An%K};>lF9Mlp1*YT6L8eNAO$GU;xFkO>HK`~wIU8tXS!xP{5J;+| zC>5xoJU>4Lxv9me$@zK3@dZVx#l@vXsRcm4gTe#KjR*4~ zUQbJ7kOP^VS(2KYR+I?TYL%XoUk>KSg9RXtP07y(h8c(i>r09^WZ;84Ha#b?xEQOt z5}-P9kUEq=henkw4hd+4fFlbY?Vvc1Pt8jy$j{6xshIP2>T97U1%X!a38(VH%=YH3 zmkTey*xPt%rTjZd0r9^326|ip0!eC&CtMDswCvVWw-!=t-ZYc#%YtQ1TMdn)FPAZM z%TB!7_S-DQBvSae@1bvN_6l!$F0|sFR(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFagbbb z36NQA1*YPY^OKTtQW^L`63O{Rsa8+{A&@|MVopvmR3zS#K@zSgJtwiaI6fycJ)ThQ!{fi^U@(k z!~Bwym=vF%n2qW|s9=0aegVXMxLL^=iJ5tjkV+~_Ee9G03XZ&#cmo3i1}Uu8rsd@4 z7eVCUfeQ-R_|&|Vg8a<95-eUYV2}lw1#=`Q+@S#;pI-{}RmGgQQ(yBnEAX`X7Z&I2 z=uCURJ6vAq#gvX1v+t)bn@qg*DX@hjrK2vT!QrslojdAtE=ujc(WB{qtFT);+{<{M zgZQG9Y@Q9)`610Tphu*=hP z5{ru=VFFfHP+C-wlL}J@4#%XT)bh-{bWot=rNkQ;7(o09)?QqapO>0cl$o3jH3Jxu zpx}dv##`bLH)aq7dmcF+AkhYPMtMeN3EUMjAeA|ZdBB*+E4G3%;*(P|bAZl*1R`8E zIU_MM56K`%XhXd%4l)Q7*(gplG{WIVGf3Q_c@$_?S!xOc*eqCbfyOm3SrtIcLY9Cg z4sbld(N4{ag3nV|58Tz_86__IBgW zo2ea-PB@1jOKTF|YCyj2gH>B+1FKn?5@1~^~}d#u7SJO zD1X{D=X&p=819lSe(TpK^IqH>S+)0BWv%S@W0jw){u$qY?NPb=Qu@B~1@E`M%}x$J zogx=C$>E{`<3+M6YxAzJ`~2lyCZFNH8QgdJ{nL(^^v(4>e(CYQ_CIO@94t(Y4hjMs^=&<`p3Yx% z(9v(}Hn|mn;aXGH`|r3g^TFPTn{j?-?_Q=j{p(N^HWK9ID>R-UclAy2t|zR8?!G6E zdDe2YXkOsyeEdi|Ug<(Z)|{d+4Q_e+eJ A8~^|S literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/farm.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/farm.mts new file mode 100644 index 0000000000000000000000000000000000000000..ffae10bee4567ef140a3577fd6055b550a0666dc GIT binary patch literal 404 zcmeYb3HD`RVc=q5W8ka@0|p)j(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFA&^{2 zQ7TXZM8@YQW;2L@#L`mpl7WIiK7`322v(V2l$-%l3!)^U|$~^D}ee%Tr4r zMy5eU3-U`6OY$L_VPfSOsflRHk`s%H@=G8tP0lY$wJJ|6NiB*m&Mz%WPGyin@c_v6 z@u_(!1^JnIB@7ZEx#axZg8X8jj$$h~vtrKM$#=OL6nI+AP1C<#*ju&4lt*1d&FP2i zhoqc&XXP85J|r`)n9gK%>Vh5jWQnxojZSA=D%)zsr#*V9GhzDP&8O5SR!w|9wMO6n z`SrSe+TI7J?Rc|)cKEl_e`VG8-p}}M^W?wWWY4xo=9&wcMMY0!ueh|wcWS=3uAr^; S6{9uJ+luoZupDLQzXSjWgrl$k literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_large_1.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_large_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..f38907d8c2ad5e0d3edb8eba71ae4f9bb29cbe0c GIT binary patch literal 670 zcmeYb3HD`RVc-SfdLUpBW)RIy&WSI}%*jbiPc62}%a1QeEXgQlU{1^|Vvq;P6_)^+ z#a3V{K0h%#J}I#%J3ha(B(;b^5~l(N5s*|`Vo`2pUbV?M3XT@Q*wT8L4GmNdBs+6 zCRR=Pr9~<6M!2O68Kh7g0ScM;)V!2}{LH)(NWg);Ql1F3EWQ|MTyiQ-cN;-NBsDJ? z7|x(@Oan1-syBvMo|BjdG(4}^3d)F2%gN7&20XSfFshjIc1ky2lL3$G?%uV*f*0k# zU0<8b!}QtlG>_UHX(6XuvQbeC5MBTK@eeByD16g# zS*v7c~lqgmCdo$G@9&u2aq zi+%RnM8vRQO2g;Od-IIj8ZV!XoB8*k!@-dLl=`}__7Qq)&-Z0tKX&vEt7l)O@Yi(9 ZA4cl87oEMn*}z@BcK+cD%#*6aH~{2>3E2Pu literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_1.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..5fba1ce15e9cf1f08779874591da62069b6e20ac GIT binary patch literal 520 zcmeYb3HD`RVc=q5W8ka@0|tHu(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFA&^{2 zQ7TXZM8@YQW-~~F#EMIR(#2L_3M3kzlvtF_AOey~OU+9Lss{;znGAwpL-LD~GeE|G zXsE)(qTI~9bgSb0%$)f0)DnovaF-+((A5Y0`_i7(5{$w^F4Ew;+bk1t3p$tY%EPRuM~kO#>X zmjIc?R$wYVKQTK#DX}O!KEJdiwTM9yrve5EkW_MhZb5!AP-U?doXH>pl1WP}%FWD6 zw<^xh%!w~gErA#XcSmwjenEVCQDSCZyb;7GRH>r;{E~QM1}TtHa2b%x<5Tle3i31a zN+2Ff&M!)}Do+HuAig-iv?w_hr(uRrcctbf1H%F2&omGdr+OoZYVS!J0 zuHY}8r8^x9&P<=?e{F`2ezCBzvdkLSo!O#Hmp?h(z4iV=*!vF$>yQ3_T4(R&`gW?e T*5^kK+LmkAZDy30uX+Li*@V5G literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/fishery.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/fishery.mts new file mode 100644 index 0000000000000000000000000000000000000000..4003ea33ad6a6e0b28b3282508f22a53d29874bf GIT binary patch literal 731 zcmeYb3HD`RVc=rmWMHp{0R{;M-rVGz_~iVeRI8NCq7nvvI5#;zDJdtFK@=oVmYI{2 zn4Vf}m6so1kXVvY%)p$OS;Qa=k}FTl$tkvisE#)@VGsccrlsa31C{3|W_lk@Y6;|q#Xi;GK(QVVhtOMucaZakPD53(*lEsa44 z!(EnG#0((z7ncCNQfyV6lb8fDfI$kR8SY__Z{t(*QVQ}j^GX=RL2_ssfNm{dkOWD9 zL$SCdKQA?@C^I=bIkBiLH3ca|(~A_Bo1n=`MV=388aIAUwl?u)R4AD6 zs8VtA<@qzGSvGBUn5TSQLOAXL7iU%H4==;dXLkj^eaCk?<=h;pwt0(Vem%RBxbF=A z!GLsod3$5l_22G)5@p*P?zB|1^w}+|)d$b)bN_zq{a+)s;?#s|KUdCwS^Dhj>8j$# qu5Y4FXTQ8v-p;41ccY={e0Kh%=B$7A;mn1mrq`OPn7uTdwgLeAnjvEV literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/fletcher.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/fletcher.mts new file mode 100644 index 0000000000000000000000000000000000000000..88d5ed81e3b029e66cb633a4001dbb9a4ba03f8d GIT binary patch literal 604 zcmeYb3HD`RVc=k3XW*!Z00uz@(cI*m__EBLoW%6hVynFT_=3cejA8~U6k(89d}>}w zL4Ial2?KLtW)TBFNI`ObQL0sPeo|6SDuXykptuAmS8N5QfU;l-VUR?5VopvmRB61S zF@q3>pd}VD0|pTcQ}YwEA+AHQ3n&_&Us{q{#2^FGk&~DQWakxIK^gJMshK&MdFc@I z(o*x1fu05F0W%pSL3+TRDK5#+OHC@uOwLYDEGkP)VbIM@Ely3&&nu2EC`v6ZE-gwe z$Vn^#>V|RS!Tflz1M(P@K_;c;q?ROS0IiEJNdyLs6&fFlN6oN^nODqtJ0(%LNr9(L zd~;0TP5W=_+nv=#n1g;@h<#t(-cxM1{jNYmDTD8_jf?`jZk}jaJi%|zw@-QUYhL%M zEPLU}`1H-54{Cko-@^iT?ei89yrI;u@@dcN;uD(%KIhHkyLu)3(cSb%QS<%o9QwUx zeqs1@{hMC*Uhm`SOaCE+eFF3HbJ zO)APv&Q4A&Doaga;Dbx0=Oh*vqlO9C>rgYmA)At)4-7yM3G!HcQoJF=PBifnptvl^ zV3=Ew42sV$ElDk6kOE1=BM}sX@u_(!1^JnIB^7htPQJ}|NP(wK`>uqX`P}!fS4aCT z4k_>}Ph3=gnSuB1_BOr;thuX}Z4!23*0r=ddE%^>zu48r!fU=?L^@|0HEp@RLDjq` z|Bhw)Bc8hl_`Y3fo%v$lp~g_7B-c~ltzR!D~=I@*NU)Rk!6}$al@YJcL?1~ouw*vsXh$g83 literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/house_2_bed.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/house_2_bed.mts new file mode 100644 index 0000000000000000000000000000000000000000..b1b118ef2e011509ac3d713ba1ebc6c3216ce2f9 GIT binary patch literal 826 zcmeYb3HD`RVc=$9XW*!Z00wae(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFF_2tI zeo=A;Pzp@PmnY`rFo=W1i%Wn?imi%s5|iTd6SINp3K;l763O{RsaDDPNl7`W3_@TN zic&%Pfh0&FvRHY3ehOGj1f(u0HKo`JNW>QbF~~TuJt(3{`6VU!xeO90$_p~{vg4sL zVDG@SfMq}?NrE&WySTU{KQ9$*i7H4cEhoP`wWuJ!q}U3=j0dvglX6OdP6m2EGX-J- z*lS>|Nky5-*~y7TWvM9)d>|9RQt3H~#l;N5AU-IdilM;}Z)gPZHHx4agCIyDO8BA% zEhvP627^Nq92Y71`M@9tk>DUtiZ_D95t?`jP+S&dHq6IJ2F2%>mZTOjNP(o`(GH69 z_|&|Vg8a<9l8QNRL!yP66?j;fzb)N%>(=XUuS^>zXn1ALt=lO%vy`{+q(tk91|OG$ z?-ImT{ixTZg}Js9a3 za_Z}m+=8(4b1ud%-rTmrw}o}yYaZLo$NG1TKfGUHyLwL4*{WlfR=ch0lFvmQzvXg% zSLfz))`xfRj$CPMTJqE|rpq#T-MXZ6TPl;T|9QVge$Ry$`)8b0I<$R;Z};=2+2{XD z%|4cWyw5(NkWVti>gd^yqx>ZcB^ow}ERpwFa_MYFfTrj|9bGq}N6RBL!mfXfGE_cu rHKS?9yx69vt7(_slX{AMZiOE2#p$rCL zkZ4kVes-}Hn9NAcNn;R4HYX=B3FIE2-wGHc!KzbJfQnO7;>$BKOHzTFOG@%{A^r!7 zB1?g^fUQMwHps(ZgTSGJ@I-QAQCVsVgA|G#m8m&7`QVf+|r2bR5)K zVC&&JKoTJ3;K)kJ&j$u2hy?pDDc%sPcnMG(B|tz?0E|&^WGaIkn+9}YYEeOc2{2f} z%y=L>zN9oKvmhR5BZDk*a3bl3#v0he@KlvtlwSZf5oj@PIU_uB#%OY&WE!8Emr{_Q znO9OV=WQ5o@L>fW-ZdpxHS2P&S^i!BuQXFpR(_$#jL&7?_GZsMUF0d3x{yIKVdfLT z-=AbQ6n11d_~fXG-nuQNpH`TB`CeIyRT=l)Be@f~7|Ye3#ob)tG^6zCv9x2mXJ=G@ z{mdvQtG`d&@5rvQ^siS%SKWxL%oR;EWh`=IE#9+s>O$3|*C95nS_ZRALOg<4X9s@d z(HGVF@=iNkaq9Vcap%}C^QteztyQ{ub8BeAnbpgc-Y72Loc&&-=cfLT_#=C+s6@}B|`n^k3JM2&X8JWc_Qm^CK{;XPM`h3I2oWy-b&2|$1 z_!3(}b-8OQUu+W6nK=EduG=mbxBW|1R~2>&o!ybTID4v2;Qq{?9Q$21ZLqjs-CLo< OyXylNzrDOsPbL7^FS~>Q literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/house_4_bed.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/house_4_bed.mts new file mode 100644 index 0000000000000000000000000000000000000000..55bc9a613d8c00dfedf50d066e201bd9e90ac078 GIT binary patch literal 1227 zcmah{Sx6O87(Q(lsg-56*y2)AmZC&f^H7v!NGOIDS9T@+zetG^=2%Y}jWG zOdv#z47^8!3YbBBLvmQGX;^ZXBi(5#Wn6ma1mEbA#n__bkW+xj1Plzs$a+m#rTQPV z31O_b74TpvIyb`BXk(DIAJ?E{%;}$s9HXQ|9t0A$j3Qx$C@S;RfcKF0tpb@90UF$* z+ujdlOxME!i4vsyJ;ovp_IM=b^`=ycoQ9Ar9p%OzV%Kzg&@kzTuF)(KF-$lPib!7! zu;73Bw0n$({GPohOHV_YPs5_DWfXqdlBFC8^6{~~b)~lV+CP`Ln!Q6N%{$)R(v)40 zzqER7&ipXIACwyWYs_9Fch{vRp_ln=ynlV(Ip36NBdT79M%Jy4S>h_ObSAE8JGrtq z<>QYcE-g57N`1yyG5DDyhfm3Ymm_xU2`x=*YUn9=wWY-;p>;%M&DmQ?v6k9xw(t+h z5pBQhT$fPmy1w~hbZ~e@c=_RHT|xWju$iT``$JwdW!!lac4S%E7cUrTA766=F?X&t zUn*Ny_0_Q|vBUJsZ~CX=*wz?ZZ%T?m)fHE$kd)4-`D&u zH*on58dE8;tso;O$7@22;>tK=Tdt$Y0b=AuYv;GwI1Z}YQrIUzbP zV(y>Yg(zeh9~O)A85sWq02i?vB>(^b literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_2.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..12d8f892ffa7c039dddaf2081c45e4bf0c8ea444 GIT binary patch literal 122 zcmeYb3HD`RVPIrnV_>QW10YW%H#sLhEj2GWwb&{@F&n~UU{1^|VvqqzOK=0HF{ivX941VerXn;-y6g(-gk literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_3.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_3.mts new file mode 100644 index 0000000000000000000000000000000000000000..cd9d00b57aa09f504b0a280c12a04f1c2e21cc28 GIT binary patch literal 135 zcmeYb3HD`RVPFQ~dLRJNiJ3(V(z(ew@hSQFMa5PnMTrFq%#a8)=*$^g!AV{<%zbH8aC=8}6<|HR1 QB&=DVp1{Ju+|I}d0PF=8i2wiq literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_6.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_6.mts new file mode 100644 index 0000000000000000000000000000000000000000..e937c82e1ad8f04445b8c259c8753fb865d29b09 GIT binary patch literal 75 zcmeYb3HD`RVPIrnW?-zZuV-Ll5Xnu>iBC(-OHM7e%1_LOFc}0vq9yr7$r(UlFkLYx TIe~%c*sotz3Y-k=t&9x-B_J3B literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/leather_worker.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/leather_worker.mts new file mode 100644 index 0000000000000000000000000000000000000000..ac314afe65a2ad917192bc7846bd336c86ce212b GIT binary patch literal 578 zcmeYb3HD`RVc=k3XW*!Z00uz@(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFevn*p zeo?Aba(+@$PAY>qNT9d`C|7I+rhu|w31N^#d16jZF;r>1p%H@+hM*-DF#`q>3{&$H zvl(PSqB)6qC8f#i}C zOLJ0+@_`1zSPYV2agZmAOY-wllZrBvvy&5x%2HDp^m0>+Qj|eybbQ=JEXv~CM0pk z^!hjJ`B#Xr$X-_9>@2^zW6|4zRZtTYSEG^rz>#)GvHqGt(1XSNCb1 zUcK=9X1jUk&87J7`louS{to-y^+(P5eY&m5{7Y8hpQELIKmE*O{O7FAiT%folKQA?@C^I>mK?o#RQj`kRUY?(y5}%)#&Ao-0-_;i6_)_*DYh!kNlXIk16z=kpPyZ91tv36bJ8Fxb5fH_Qj7AepfrOx z$V4>l@g?~M45}cBw4D6%)S`m?l42_eGakr}Ps%AxjR#qtnZh6gQkIjL2QswS3d)F2 zPR-28%u8nw0UMH>UA zvXT>v%2HDplnEJ71XLsjQj`L8Re-Vm#J2~b=bq#h-75cWbefg>K40OHFN zb8;9I@o0+AF9pU9B*5S)6qG#UQ}a>^@-y>FD(1YM-dNPEz|*F@pscJoZ|$ykso!6% z_7Rx0U`plXyFZ_=OR86?nV>DE5O}jMX-03tp)(;(PKw8uJH?q*S$0|Q_gl1lf2hJ)t(YA6CNJz3l?q*PoJmf zy!pg|%9lK98qF)k4cGlVnfSnVe;kYPdCUGVfpG6B3$HDVXfwb2`tG&f(*~&vc`C|$ zLrM#+y^cST@R?e`bJ@f6K~&dC@o>lbqaSwH{DQ3AwWhY44P-X5Hwl_^~}fweY=7PUWjPyK*L~yC^i< WKdE8zw{V^#cQbYNL+Q)j+mZm8#>>C} literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/mason.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/mason.mts new file mode 100644 index 0000000000000000000000000000000000000000..9dac4681c24e6ba59e16bb3c0521a32b3842838d GIT binary patch literal 586 zcmeYb3HD`RVc=k3XW*!Z00uz@(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFevn*p zeo?Aba(+@$PAY>qNT9d`C|7I+rhu|w31N^#d16jZF;r>1p%H@+hM*-DF#`q>3{&$H zvl*nYiN@!bmZTOj$bjT>67zuUykaXTBR)AbGbb}I9b#TuYF;wXLqL<_!Au58kRGsS zic9kIQj>}@le3c(i^@_{7^ERq0Y#HbOMqqq{RU?<=;fvsrzYp;6~`A8r4|>L7Nr*C zB$fb;hH>M;{CJQ}`Dtkocf$h|6q@m=c_{_?nRz8xd~b$D%(!CC+sTc5%?dm&`6Zi$ zpFflT{o470(^XExyv~#FgqCE~W(GI(=&?&1EVy_~c-^OW&nl-L3Egx|*89w>lblcA z*?eU4GtkwFTE9L_@NinCPT&L6bDHNLEv$I!*6#JHd(ZPG_Vbs&${xRc+5hgCK literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/mill.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/mill.mts new file mode 100644 index 0000000000000000000000000000000000000000..6252297d240d93b6cddfb8f3913c660c6102ec7a GIT binary patch literal 573 zcmeYb3HD`RVc=k3XW*!Z00uz@(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFevn*p zeo?Aba(+@$PAY>qNT9d`C|7I+rhu|w31N^#d16jZF;r>1p%H@+hM*-DF#`q>3{&$H zvl(PSqB)6qC8;Og^m0>+Q8`Wd*U+Cm^SVOSvSj=X&bHuf}pIk7Iw@Pp|v=V|`o7{t3wz{%?Oh zz4Y0@Zr9dDb(Y$%U6!yotADxtyufbz+mAKH$FFfZW!L8<`~6wq@|88|+#@Lf-`wa( literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/toolsmith.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/toolsmith.mts new file mode 100644 index 0000000000000000000000000000000000000000..f048608bfb237323d373ae9067812eb487b8c988 GIT binary patch literal 907 zcmZuvT}V_x6rNBd`>~MKObaqfh}FnIqYK6sVw7!BX1Ik;v-i&KUia?Ia_6q@_7Y`E zM)hD)7$rfF#8yiWg@zOqX;cuQmHns?5mY8-=tE#MGgm~b`*6<8xijB6-}jAse}x+) zgH(_L79N!!$Oai9)qr)nVIV(d3ZXEJtN;T^NH@U}@lT~DR#fWs8W^ODf@NZUQbb5m z5IANIc}-mnLa#y9AjlEbFe3b##FVj=_j3}k^!2}4aaAb>=M^~f;5N*l_crUYS1 z0GS#lSc9s8Vzax~Q>w}C5=!7$Opyt)kbsg?`7lv=2RO&HNAy$FK{3wV7bkJE5mutznLybme-prgE8={xKx4utn zShc9BJfrvX?$Pd!!Fb|uo8xM{XQXzj;n==k9@jjFFEbr1h&iw9`s8`3?pS*!p5Nnd zi8WO@4``dK`ktrM4s3kZI8YtE+g9D8rUfU^*C z7T$v2?yal3*85b=Ca%`J{@1rhb3bm~<|{eZ9csV7z2eP_-#Li~Q=z>TgEcpEH&w3r vx|;nQK9qZ;Z`|?DHKGj9_eHfk@v<6MeimAc9_G0}gi0sM@MOyIjspK5ss3(i literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/weaponsmith.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/weaponsmith.mts new file mode 100644 index 0000000000000000000000000000000000000000..6a8bd43ad5cd11543905756c55de07090741e5e4 GIT binary patch literal 913 zcmeYb3HD`RVc=$9W8ka@0|qGu(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFevn*p zeo?Aba(+@$PAY>4Tp+0^GdVjxDJMTUn?V{RT9B9r)DI%#^Abx+ixP9<({d6^7-T_` z#U()FimkvD&_Iw`@%g1CsYMLpIHV!^lJj%&i@=r?TV*5`rKIMiro<=bBvvv=!d+5a zlAo6fc206)QCVsVgA|65`H9)_nR$6Y>%bmBaSc$8K?tOyq$m~Wf%5$Plz5Ps07xt` z4;V7VR$vNZWqMI&UJBSsD+Ci_Y+7kiUScxP3@C#^3~X$EQE~=QumnWMmnY`rFvuV~ zFefny7(75P#HZw!!oxT%H4kJG$l+ingKlnWacXjYUU7UuQEG8p;EZP5mv=Pb=F z-buG&*#6gXd|&9uCcVFEX5Ot_MYcwfBL(TTiAA&O?a!ntWcO@sOS~ZKF8yI=jYQkU z)jik4?9VPg{nj?0vw8jXHUHb|j3%YN4_*Cl)uich3tjw#>eo2DGE!vWzq%txR^_$8 roQ(-yPAMu+y^DHe+EyHP={==Ue!D&Tgn#|7oiA5E_`-NMMb{SqBY17; literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/well.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/well.mts new file mode 100644 index 0000000000000000000000000000000000000000..702baa5d3433fe22543b62526edc2f0d52ee14cf GIT binary patch literal 409 zcmeYb3HD`RVPIq6U|_3<0tQ|N-rVGz_~iVeRI8NCq7nvC5VtHdCnqsIwb&{zKfWNb zB%_!?3Pl(s7N44zQjnjSSHi%Ym|4Ui3^%5@BtI`TsVFl!n?W2TSe}@ZQ*4D0jW;x9 z5W^~Az#sz>&q>THNiE7Nwt_O^lT$NuGV{_IL_o4>sd>pjm*ppBLzoboi%Wox0NRq1 zm=q6`V&DfU1^X(!D6uRx2jVZVKzSn2^!VcZ(xT*4hzrp)$Cu<6RLn_EIKU{;IDym0 zNx^uI8n2PT1_woEuGxa;*k+#MQlBY#Fi{%;%o9IQe|u*&vW+XD+ZwVdw0M z@5M$R7#=#z@Xz{@pg!?1d-0M*4CP-Zbpilm CteKnu literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/utils.lua b/mods/MAPGEN/mcl_villages/utils.lua index 061354827..c35f3770d 100644 --- a/mods/MAPGEN/mcl_villages/utils.lua +++ b/mods/MAPGEN/mcl_villages/utils.lua @@ -86,13 +86,14 @@ function mcl_villages.find_surface(pos, wait) end end ------------------------------------------------------------------------------- --- check distance for new building +-- check distance for new building, use maximum norm ------------------------------------------------------------------------------- function mcl_villages.check_distance(settlement_info, building_pos, building_size) for i, built_house in ipairs(settlement_info) do local dx, dz = building_pos.x - built_house["pos"].x, building_pos.z - built_house["pos"].z - local dsq = dx*dx+dz*dz - if dsq < building_size^2 or dsq < built_house["hsize"]^2 then return false end + --local d = math.sqrt(dx*dx+dz*dz) + --if 2 * d < building_size + built_house["hsize"] then return false end + if math.max(math.abs(dx), math.abs(dz)) * 2 - 6 <= building_size + built_house["hsize"] then return false end end return true end @@ -193,12 +194,21 @@ function mcl_villages.substitute_materials(pos, schem_lua, pr) local biome_data = minetest.get_biome_data(pos) local biome_name = minetest.get_biome_name(biome_data.biome) + -- for now, map to MCLA, later back, so we can keep their rules unchanged + for _, sub in pairs(mcl_villages.vl_to_mcla) do + modified_schem_lua = modified_schem_lua:gsub(sub[1], sub[2]) + end + if mcl_villages.biome_map[biome_name] and mcl_villages.material_substitions[mcl_villages.biome_map[biome_name]] then for _, sub in pairs(mcl_villages.material_substitions[mcl_villages.biome_map[biome_name]]) do modified_schem_lua = modified_schem_lua:gsub(sub[1], sub[2]) end end + -- MCLA node names back to VL + for _, sub in pairs(mcl_villages.mcla_to_vl) do + modified_schem_lua = modified_schem_lua:gsub(sub[1], sub[2]) + end return modified_schem_lua end