2021-01-27 08:56:53 +00:00
|
|
|
-- switch for debugging
|
|
|
|
settlements.debug = function(message)
|
|
|
|
-- minetest.chat_send_all(message)
|
|
|
|
-- minetest.log("warning", "[mcl_villages] "..message)
|
|
|
|
minetest.log("verbose", "[mcl_villages] "..message)
|
|
|
|
end
|
|
|
|
|
2021-01-29 05:59:01 +00:00
|
|
|
--[[ Manually set in 'buildings.lua'
|
2021-01-27 08:56:53 +00:00
|
|
|
-- material to replace cobblestone with
|
2021-05-03 20:11:49 +00:00
|
|
|
local wallmaterial = {
|
2021-04-17 05:42:49 +00:00
|
|
|
"mcl_core:junglewood",
|
|
|
|
"mcl_core:sprucewood",
|
|
|
|
"mcl_core:wood",
|
|
|
|
"mcl_core:birchwood",
|
|
|
|
"mcl_core:acaciawood",
|
|
|
|
"mcl_core:stonebrick",
|
|
|
|
"mcl_core:cobble",
|
|
|
|
"mcl_core:sandstonecarved",
|
|
|
|
"mcl_core:sandstone",
|
2021-01-27 08:56:53 +00:00
|
|
|
"mcl_core:sandstonesmooth2"
|
|
|
|
}
|
2021-01-29 05:59:01 +00:00
|
|
|
--]]
|
2021-01-27 08:56:53 +00:00
|
|
|
settlements.surface_mat = {}
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Set array to list
|
|
|
|
-- https://stackoverflow.com/questions/656199/search-for-an-item-in-a-lua-list
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
function settlements.grundstellungen()
|
|
|
|
settlements.surface_mat = settlements.Set {
|
|
|
|
"mcl_core:dirt_with_grass",
|
|
|
|
--"mcl_core:dry_dirt_with_grass",
|
|
|
|
"mcl_core:dirt_with_grass_snow",
|
|
|
|
--"mcl_core:dirt_with_dry_grass",
|
|
|
|
"mcl_core:podzol",
|
|
|
|
"mcl_core:sand",
|
|
|
|
"mcl_core:redsand",
|
|
|
|
--"mcl_core:silver_sand",
|
2021-01-29 05:59:01 +00:00
|
|
|
"mcl_core:snow"
|
2021-01-27 08:56:53 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
--
|
|
|
|
-- possible surfaces where buildings can be built
|
|
|
|
--
|
|
|
|
|
|
|
|
--
|
|
|
|
-- path to schematics
|
|
|
|
--
|
|
|
|
schem_path = settlements.modpath.."/schematics/"
|
|
|
|
--
|
|
|
|
-- list of schematics
|
|
|
|
--
|
2021-02-01 21:45:22 +00:00
|
|
|
local basic_pseudobiome_villages = minetest.settings:get_bool("basic_pseudobiome_villages", true)
|
2021-01-29 05:59:01 +00:00
|
|
|
|
2021-01-29 18:49:33 +00:00
|
|
|
settlements.schematic_table = {
|
|
|
|
{name = "large_house", mts = schem_path.."large_house.mts", hwidth = 11, hdepth = 12, hheight = 9, hsize = 14, max_num = 0.08 , rplc = basic_pseudobiome_villages },
|
|
|
|
{name = "blacksmith", mts = schem_path.."blacksmith.mts", hwidth = 7, hdepth = 7, hheight = 13, hsize = 13, max_num = 0.055, rplc = basic_pseudobiome_villages },
|
|
|
|
{name = "butcher", mts = schem_path.."butcher.mts", hwidth = 11, 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 = 7, hdepth = 7, hheight = 13, hsize = 13, max_num = 0.1 , rplc = basic_pseudobiome_villages },
|
|
|
|
{name = "lamp", mts = schem_path.."lamp.mts", hwidth = 3, hdepth = 3, 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 = 8, 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 = 7, hheight = 8, hsize = 13, max_num = 0.7 , rplc = basic_pseudobiome_villages },
|
|
|
|
{name = "tavern", mts = schem_path.."tavern.mts", hwidth = 11, 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 },
|
|
|
|
}
|
|
|
|
|
2021-01-27 08:56:53 +00:00
|
|
|
--
|
|
|
|
-- list of settlements, load on server start up
|
|
|
|
--
|
|
|
|
settlements_in_world = {}
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- maximum allowed difference in height for building a sttlement
|
|
|
|
--
|
|
|
|
max_height_difference = 56
|
|
|
|
--
|
|
|
|
--
|
|
|
|
--
|
|
|
|
half_map_chunk_size = 40
|
2021-04-17 05:42:49 +00:00
|
|
|
--quarter_map_chunk_size = 20
|