From 08b14ecb134a577c463c28308ad489ec9bb0c369 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`K)VrEgX6_|=IF3HbJO)APv&W_J7ElDk6kjA5gK^P>NoL`h` zh0wO z{`bz`uho3t&d^vHe7w8-W8<{b)7!W@WVT(6O>1~?^-K9K_kik$tS{M?eh+$Snz_=Y zbnd);FDn0^cq7RFP3*3rZDPW{>EHj)wG;c2?)ZPst#kK&-M#&;=J5Z&wXd($g@#>S xa%)}mqa#N5^xj!LT4kyiFIQguXuYN1^9#=_yRJpmSXLk3bjkl3i(Ih03IIy6%25CS literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/blacksmith.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/blacksmith.mts new file mode 100644 index 0000000000000000000000000000000000000000..3ec77a91dbe06a5f86507fef6576f4019075b662 GIT binary patch literal 770 zcmeYb3HD`RVc=xoVBoHY0tPV#(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFevn*p zeo?Aba(+@$PAY>4Tp+0^GdVjxDJMTU8)8IpNn&PEu~l(SVp4o@Nq$}`gBVD0Nq$js zMryGYn2s+`%*kO80*MzS=A{-}B_$Tcr{yG;Fo=W1U`BvUiig@L3$ZaLzX)tsu~kN5 zQA%oFYD#=^PGTj4JchoM%>1IvlGOO(-2D8K42UB@E+{Fs0#otDxgbYKfi%Ls4f1n* zYFFMX?H+M6vJA0TjX`W42;F%M}Qco=P z&u!lJCqk}n{_BZCdS43Wtv1|mZ+@_L-(|j8w_e)t7rp%0@>A35Q}F)n#U|Nn=Rc`` z7^pUX&hu2a2@!89_s*7!uD>4AJ0g<=4>IQ{^C_P^Wk(^-b;4{(sVrID}GGS1pq--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 zcmZ`%dq@;P7$193iJFROT`4`ZKzgVN(P~8fQDJ9NYAJ}r+}@mb+}`fq%=)+}rK60? z(n3&ztFXu(q9v#tq!1N>DGExYrA1nrNT+#}6ne()sz}=W@qP0>e!rRTk(`#A3|4^E zU=0W;nma%P)>&8%=9xGS!#iE9i6_1|hP;fO!^EMnGou z3W8*>BoNk!DWhnxejcee5eep-BqPirh*A)`C>iD>jsqK(qJ}w0!XQ|I5R564F9>=l zAT!t~`$WWJ%E%J(NXjLMg9Z*s3js1r0VpIYK!=E$r;$mhgiM4oijp&-kSk%Lmili@ zEtOgXGbW6xz-|ksm=$;mMS>~KC0OK;B>!vHgo>?F8w@J3Nx~KbK^9CIMX6($dyYdo zNF{;CYFCsAD7KE6STl=A9@Z}y4u|x5Ow`Wm1%XgTmdb-V7`vojg0UcMQT4M^Rst%K zM3AVGiI@lB|3S>QOljx*D#?2UF|QW|6E77wzgPNGdyHRkcW747Ep15ulYR&_T|G%( zN5!-IK02qLM%mnr_GNy@rmf)HW~Vl=bVqqhZ@VVdMglqq-?f)aW!fsf^hO?On|L*x z`Epf;Z*rmrhWh#?pD|`PCVo2HT7Um{z^_dSb)Sbl1v^`29PW&P`ex7bdrh_av=?DV zTi>2{w=|?T4AdML+MieO{!QtF>$aeAmuAowq8)ThKk8-2Qg)q78mc<@Gd#ur_=L-2 zz0y&3iHh0r*2J-?`1Y>I+kt%3mOar|KTM9qMNc|`YpbKAX1vdpZJn|HDXbhG>3p1C zY<)K$QdFRv#o9kpB%)04`skl+Sa&+i|H?g|A tJmIw%u{W-)C%AW;*XXV~6jgWH$DUeR6iCSS#%Gu9ZOx8CAL9?8{R@#^nZN)5 literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/cartographer.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/cartographer.mts new file mode 100644 index 0000000000000000000000000000000000000000..f1c51a1abd4a967f88a20e2f150dae97b91c1c98 GIT binary patch literal 792 zcmZ`$T}YHc6rC^xGhA6S)6jmPq`###HJUPrL}F{BG}1^L=KFT`hn@ZAYi4%0B$TWc zf~+J&6p1JjG$~qSR)omr;oiCT+&P>($9t&G3l@Sb zkO>yI>I3pYe#E3G7NQgfh=3MDHkLsFGH{3khr&$82{f5uPy&{#hK(&Epo+-CGRiSU zeu^b1QlOAH#0As|F&suLDhUTm=EJ~J%^xH}3aAqj5lks4)qTt*3vg@)Pa=s8O5i^o zkf#O>#=-*X7$nr6W|fR9MyNB2E7n5Istl=ysG@#nAUDXF6C0pdh4*$#IBfFQ_<=k8Tr-pV!Z18&b|tVE!e)E4e{8Ip;Vc< z1NDv#HSfOrIV-zcv}`?<>iS(%^|s-IB#L(crtA$(CKsJ?CAW$Jdpi i$pPGdsd3v#`N3&V?Sm%A%veoXea4LISksL?rGEg)emw{P literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/chapel.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/chapel.mts new file mode 100644 index 0000000000000000000000000000000000000000..0c2ceacfae649348e7c3d6af0768cbba89c7d996 GIT binary patch literal 635 zcmeYb3HD`RVc=w7W8kU>0|sFR(cI*m__EBLoW%6hVynFT_=3cejA91n#LOZFagbbb zNn&PEu@#t#PtH$D%1LG52T3I77o}Q31%yBX<%u~t#ZZxWO9n}}qV$}^;^O$6%=C$iV{_6teNDc_{_?nRz8xykNi}3o;AlNKm*#13W&zv?R5tV$R#Culbr4cv}4n zi*t5#roG=CE-&pkk9_(y=i}d%A~a3wgQtNOqDk5!4rqB-%WUY(qCWyz&^ hp`p?`8>h}l5^VQg^(ta_DCg=+tF-nqzPKkS3joS)|G)qM literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/church.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/church.mts new file mode 100644 index 0000000000000000000000000000000000000000..a387f62fba7f1d46a56ca494eb9b1cd16bba0621 GIT binary patch literal 1187 zcmeYb3HD`RVc=unWe})G1`KixqPfXA@nxAgIf?11#a4Ow@db$`8O03DiJ3(VVj#Ja z{G#NH)M6_z9bcZ9lfxhd5-%=E%q%Ll0#ot%iP`b_r6s9F3?kU%82CY=$@xX8R>}EE zNja$u!pO>U5|cnCFi3&~3lj5Ei>*Lpd{R+4PGSjz5J;+|C>7+8qSREdawM_x z{QMNKm^7LZxrynic_oPuL%{AvGC#j4F)uw8A_w+sd47J5RdHrcS!z*ya$-?IY6$}$ z$Uv~m({mDwi;>h7lol1_q{7sJ!!fBSwLCK~9TX^eDe(pd1`vOOwHKG<=cOhUWhQ4s z%}C720R{E0LK$NO@b0+d}>}wL4IalNyVJE5uIht3IZ(sTQZY9W`D`szjgmTR+q2?4BK30 zZ#V9|ncDH_gmd_@v?k%rmgg_-xPCRo`>d3I_JYz(^;5x%crR4QUh27?*z3NfE%(XvD@WTn@xyZ zZ@u-dG2?yPtc%Bs*JsUMB75VoM`erHYFYPNg-dq+)>%C_*>nAO#`V_uESc9IUYfV| z?CZM^zUsZ$8nSGU9pm(GzhoZ&u5pUq{@wW2uekC9HR}yy*BefseO>j(?#jDg&wTvl z8n|nX@~2&MuJHI|p9sRa$lUorOt~F)7|BeeYAMA~|8RuvA?q!P8zYaxVBSB8SLgNW?SKk!xdcs=h z?t9{xXDvsI<^`V4$B(q*l`b@7%_$1g;Fh=F=d#^mMcZ!wttTGEWnSoQ6*$DNU2@z2 E03y}>8~^|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 zQEF V3ffv3u8 zO0`PKEGmKMhg+UplwS~^UX+-b7jMWQ0aA%7Rg|A!5^soGlQBe7a(-?>esM`^QLz=A ziB(g6X;DhN5pF3%1}PLrfI=odH7}(gKQpfc5^!LzlqZ&?7R49mmlh?b;&itWG(=MK zl2ePVK;Z~x;#6-8u{JO&&Tc^aKIT=%y~Pdo3F`$$8~q_+F-$p z^53qnP3B?x?0A|-?T)mN(=FMkC9}%t_LpbJ9S%8IwpPe3KX)bg;%2Mpe(`U)uNLO#9r>tTc+S{QxVF)(>eSA4LH_46 zABx33`)wj(STLpGbLPEy#%+z4&&JLCd(h!vNPkLw-B 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 zQEF-WVd2 zoS$2eUtE$}RBQ!jLOhn7UzBQ9o>-Dv6knWQT9lm1AcbNS$g}aOc_{_?nRz8Rtue$Y zV}#q)h81((PWI+&P~dS{{@{Ok>iWE+Z4)>ISxO)KJX(}l%O|D~6mp}XXn0;xOyltp%o1*{PSe9+TZIp0}p<{-e{ci?+6VcRrtUOt!_^Ygec5jG424 z)qnn^cg*n5+6!LH)luGb{>N>Bs_uO+xXx{p+-!O0_U3@y QmohEW&)j0j5)$A50Htx)cK`qY literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_2.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/farm_small_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..4fb5a4d345841654b8a8a1f1d8ff5bd77090e011 GIT binary patch literal 487 zcmeYb3HD`RVc=w7X5g%^uV>(A5Y0`_i7(5{$w^F4Ew;+bk1t3p$tY%EPRuM~kO#>X zmn3Eu65Tj6~it_VI;*A-kKt{o3KrW9@%}XiB z&&(@u;O1NCa}fIy?7qS%b&|rDY5o z7Wjnc3jX3*y3?`X%=Bsg*JkMG7YiFJ%dBzTnJvn6`IFP#TkkJ~z5j5q{^MT&eSYMiZMk;cW=47WswV*1guR{s 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$ti}ajyE)65CI9MrRF847F*>fW&oKkOFCjdl=-~_|&|Vg8a<95(aUQ9GZsslKcV& zNst6M6pKsp^HP(FGLy5D6N}1HQ;U8$YTjlM1x_UPnn$BnEPioHkXCKa7Xli<`sfyW4!)Yr3`}w zL4Ial2?KLtW)TBFNI`ObQL0sPeo|6SDuXykptvM4v#8h#OvOVbgh3MJi8(pNP^IyP z#tcFjf|gjs3>ZW(OwCWshPV#JuKdL8`25n6)FK8MkdB^6z1RyY_jD2;NZYSNXJOb@7SK0-y6{@?E_W{^)M{qp10Q zcMkntGrur=y8cbCd$0HK)L6azIJNTReU82ReC7WC%3S&X?A}K|o%bJ1PA&73U--#pfqxGl*jmj4#PAU=Tr;0BHg%=Ld-< z=NF|~CFdt4<)ktQfdop5QbAS~rKW-vA&Hge=cj9D3OsGvcO~S^ z=e~cvI@)h>NP%B@;-dP?47_i*xA8q-&0V!@ldu!BuBF|{6KB2r#jZ9MUi1AT(mB(p zY0LEus^&fUcP!H%@!UPY_w7pS%oqC(HHI1`xt{uNefHJs2Y34Tzf4|m{M5vI?H>H4 zRb2^X*_H1n=|yILwKMp2;ND-Idwbitf8Kg;CuDqUN5ZqI5xJpDW*%=f&M(z9c>aF} z|J!fZ{a0B$_VlgQSQ_%-P@8{2XvgRBect;tf8Wgix^B*?*zE^{r%o+pSG4%Q9RRzC BCaC}b 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=BpYOxiVjxSHl$zc!&i5Hh7W)>A&73U--#pfqx$Cu<6Fz|yUlJkpFt&;PTl5$cR zguo^grGoSqrKW-uB8!#h=cjr!+Ml z(w2+$N=sH5v9^k{j6M%eYQ wQHIKAu4XjNm>1jhv~~JN_35`aA7Y%r#o@knp;g_JoF&^mtM@WGAGG)f0O74x0RR91 literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/house_3_bed.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/house_3_bed.mts new file mode 100644 index 0000000000000000000000000000000000000000..6324f4ff15f063d7c1f215cc748afccaeca4b89a GIT binary patch literal 1086 zcmeYb3HD`RVc=%qWZiG6;bc7Nvre6{V)e=O<<(izM?TY<@p)SNU1ab$CH5|cpgi7&}7V2}i>PE9GcN=i+MFVDy#$3Zw;WEsC>29tIl(4i$tak`s%{Qd1bDQ0%Bo&B@6xhgkx47~B%59LN?_ ziK5gLm=3V@a2+5CkaBQjrR3)q6X?c4Y7)s#2cap2q+5Tp^>Q!a%@^oetBw9 zL4HZG6@(dIkY5sCQks)l0J4!m7CAVPbVFke>|uDSN-oMTfSMR@h)2!{kDM`@94MK_ zr{<*;pn#vcOgmflOKdbAu%f)T~Qq@(3okC}Kq%O{$suQ?B^C!oCmrWZi U?pOC#=WTHlLL6Hv|zuuICp7_W|JT0zzPH_k>6g&3wFp)4c&Alqn}dnHLGR>r6kPdw^L8 zi@;kANWgg0)+AFMZa|__uIs^D5XQvI zfDeN}nN`Kw=%MYxWhJpW{bNxQNCuQah*_;bG)zoJb(!n-?$y3sF=u7c(z8Xcz6**? z*H;5lHTc)U7OAJjN3o1Cp`3X$B1Jydi``3a@UbAY5B0s*Xrk%Shd2qUNY$-i`v2m) z#>htO+k12Ad8o_jSk;Zp!q00DlD(k;0gjiRw09lOPsN^B{^2909%y^hkX?{Jr*cWo zv`8TD(&~b$tbYBs)TAY&r}<)HP;K6cz|^t*DxOEg)GS&$+f!_7Nm|@=ctJ<%hwmq) z^subawV8v}ut%;OIW-5Ki{7|3q9m!IuD#&d+BX5K8vB)39lw?wZ>wJKh<43Om_Gw6vCNC`)XabIMxbyqVGdx?H+9rRM(It21NVA-gYjzRb_gm6W)==qbOi z7ozaFa(sfDbD{GNch->^ae0To-@kL-|L9RIYidQH9^4GJxr?0Z9-sbX-~Obd;P;}^ WA!X$bze$_ngOvvh_u)qQ+1)?RtPFGj literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_1.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/lamp_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..0b06c7b7b446c4a684165017ca434f914d3e8d02 GIT binary patch literal 84 zcmeYb3HD`RVPFK|`uh5M1||lP+~l12wA8%h)MBgr#B2zYK?)?AlbBbMT9j981!csi Z<>coVRm@3FU|>F0rND5JftP{tKL8i88zle$ 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_>QW0|pibk=*2*__Wl#*L{U?zhoNHjk=H8IbsI5jaoCo!)iwJ5J*PIAHlCW(V8!cr$s9N?LHaM8Yb X91Rx~ni9HiBC(-OHM7e%1_LOFc}0vq9yr7$r-7|R$#hf UPI3YR)3IN_suVaG*jpJJ03{$80{{R3 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>qNT9eRF|(-H3QWaAC4@l|<%u~t#Zaa3hDHoR7=o5q#0(fjFig!) z%w~`QiRL8cm82Hs6OG{FV7{oww z$%&;oDMk5t#a1vDgCtlSgiNr6hH=H5x53?fhZK0$ zge2~mUjJr2{|XTn*~OQU0s~3LXY&Y+`xfK6h|5Pv4-(kPI{-`;>Pq#Ihf5|HRbF|d&r=NL@|D3hCyl2gy zt8WY9Gz>S+ubVx6+5f|T`_~1YIlaBW(?v+4tc$buV!Q3vMuQ(K{1Xml@k=|rd&B_% D*23s9 literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/schematics/new_villages/library.mts b/mods/MAPGEN/mcl_villages/schematics/new_villages/library.mts new file mode 100644 index 0000000000000000000000000000000000000000..611ef561043770bfb1b87e1eacda7f23fdcf743e GIT binary patch literal 1110 zcmah{ZAcVB7@kUq>bTO*^UR2|w6rg}>_fMrOri1v6(vi`X?Jftw;Ol1oxM9P&FbQy zz_c<7x(n}Dm=r|zUGzaxpWv; zOa&DgA^Iwuy&}0LG))$)w$+*P6?ujCnANCj3{-;NW!dwDD!g*wY|!PLhASd2mRFiDU&6eI^9Y^X!k_Jl~ZN<xqHH(T;{t&F~X zd}ZOHtx01H0~WTWcWb2ASDv)~q_^={WR}0-$;>g^ z)|gUjdYbm-PW0s4j?GOubLV9ziL|2og& z&R3o7Rn7B|UsvkP%yVp6l6L#KDdUi&Yg@gryI}9#i2UTrrZ<->2D@}sB_*xd0sF$- z^xlnq?j7TpXWO5isB{;6iyx7o>vFa?*Q{ziZK_`KEW^+eX&YI0E#X5bF?ipH_W6t- zP0ht}DjSoO7D z*%;9m-|;AIMc~2J4He0fCnWxCfoH*maMP4~=AwbAk2ZJgDIGk&DR#^2rMT>+_Y&Se aBh~C){=9r-R$_{G%42l2C#o&|9QPfW#>>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>qNT9eRF|(-H3QWaAC4@l|<%u~t#Zaa3hDHoR7=o5q#0(fjFig!) z%w~|nCK{h#T9R7CAOn)iNz5xrEy^plf->ThQ!{fi^U@*arKRR2rxsh~CuT#K43Z!{ zV9yknAYsDQ8;^m0>+QP!D^6U^sNpI&pdHZ`uUO8(b=zqN1nyqP-Rg-g0i{o@{+{&Q2qNT9eRF|(-H3QWaAC4@l|<%u~t#Zaa3hDHoR7=o5q#0(fjFig!) z%w~`QiRL8cm82Hs6OG{FV7$iY* zV9ykn!LbK?bj|#Se(_rTz+0)xBczMn&RWvIGwWVbCUi3EO7bCnsn}w6ae4c B=tuwn 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&KUUzn8nYpXGy+oOk zQ9YOxMoADPVYT#7Xh=bkMg*Ms39K^-L4GVW%3v5-0RfVb$-xqNrZbK;oq4?kgLDa49Alx$2pI|j z$IMS&Zt6kkB}@;39EpYz#X^%2Qe;IqBG5;W1u_*4<9a|6$qefeAz-CVMHp8kLJJ^n zV2TZ>6BL_Wy`C{cRaaD!#}b-KP=q9v>dJ?yj)lfh&|cc8u#m}xrjp{wmSz7&p-Cy` zpdf?=))^Hr%&`y=j>805QdMFL)n4*IM!|Ah0mquK7{zKLI^uQMusbyv<3f{B-SEP~ z|Kb)b1k3*EDq+G>d4Oo0Nra}7Envn&X&}VZ2s4vfAWPANOe(c0;TWBY!2T=N{h%yh6I=Df1&ljo(rW9^yF{9b=ctf|U* zz}Q^X|2(C3aO1Pa!RqMUw(1r=EjWoDzrE-w_Mo=PA6*Ae;?nAtqWJm~CC>H>4M|1u zXieJL0WzL7)wSpJ`B%xkTe@?GMw>m?cMf-diCk`OOmz=Wl#f5jh_#<8d33{Bcnf~J zx3211-%~xCx?1xFUf&+e{kV0TujE`$sQv!-iZ?HQ=fodOhxS$s)!fY8RJrEsYVmXA rQ0|fb3CBCvs5Ua+7d7s5mesiOv(RGnFwgxVR61FPr&5l06!`xDss3(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 zcmZ`%T}V_x6dubqO-U2`aaB^>haQsDg6cx}lMp0ZP-zcF)9k&Yd)e8UW#+DHn(n5x z`mnu75`_^KWaLIg21;2$5z!y@5Qb9pB4H}^uoXsR%)PcM)jZ5O^PQRReCNz@9@y^$ zi68~oKyuJrzz$Y>RRSAyLQp*x3T4oT47UJFk&1iwiQpfjL2FF+^0md{FOP3g;4LT8u zX{?m>T&J3uQki!x+B!d{NX0^#bHEytmT}dMg<@J5K!kvtg#rn3L6Z+^%pdP@9j1~= z3O8L)=*0r7j0))ESO`DIK7tI{@wp>3&t|ENTB$Y0xKQM7!Y)|+Pu%!}OPz*LOap~i zN?p(y*`N7t$wI{3Sir5;y+v4&^$+pMl4Aui)qG5+Mq|%(_gF?-UV8Xo*{$f5`|H4P zQ_`J;l$W9L^Rp}U=ARYL(30wutWYO89gE!Up1C}*ot=DN6o@@;nVGWNhda@wYdE#` z?L_19=4}sFWo6a`8Xe&kO|frq(}ne$w+w>hjXNicr`q(sQ2DZ9M?t~8u9iI8#T%&~ z6WdQzxkeA!W?PfK_mC*LquzYm@ytiQ`WD2`1xugfJWu3y7`@8fmHlPt*t+oR z{>Vs8>5IN+(>qvl`}L9NY)5NJ7yew`|LbbknZv!6doqI2vQH)XiD_>J_vJb!(|c|n n*9VK?WqAlbBbMT9j981!cr1r)K74=A|=;fMnBB^O94Gt@0DIAxwzP#U+WEMa5Rd zIf+T}`H9&K{2--ZU!@l%mZj!E`~?;$Pb^6-iZ9MDElN&>xDZWqd`W&m#hm1X1B?=l z6F7aG6pZJn@fsOya8P9Cnk{&aZRRO1^_h}44*W_`u@;)meC}C`lh5a!4FYL)<^r1( zcFwN&UTpM%;i1C}|EwPg>JtyMm;XuXP852)y-wr-tHt5@Y7KMex_sSI$i~UQQ2upN FCjeutnVbLs 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