From e716ebd911ac2c99de7e3170bea4eb9bf30de800 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Mon, 1 Feb 2021 15:45:22 -0600 Subject: [PATCH] Make enderman grief less frequently, enable pseudobiome villages by default, and disable natural village generation in singlenode. --- mods/ENTITIES/mobs_mc/enderman.lua | 8 ++--- mods/MAPGEN/mcl_villages/const.lua | 2 +- mods/MAPGEN/mcl_villages/convert_lua_mts.lua | 29 ---------------- mods/MAPGEN/mcl_villages/init.lua | 35 +++++++++++--------- settingtypes.txt | 4 +-- 5 files changed, 26 insertions(+), 52 deletions(-) delete mode 100644 mods/MAPGEN/mcl_villages/convert_lua_mts.lua diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index e8b7c73e3f..b2971ae458 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -43,10 +43,10 @@ end local pr = PseudoRandom(os.time()*(-334)) -- How freqeuntly to take and place blocks, in seconds -local take_frequency_min = 25 -local take_frequency_max = 90 -local place_frequency_min = 10 -local place_frequency_max = 30 +local take_frequency_min = 235 +local take_frequency_max = 245 +local place_frequency_min = 235 +local place_frequency_max = 245 -- Create the textures table for the enderman, depending on which kind of block -- the enderman holds (if any). diff --git a/mods/MAPGEN/mcl_villages/const.lua b/mods/MAPGEN/mcl_villages/const.lua index 09c1743423..4e2b39136b 100644 --- a/mods/MAPGEN/mcl_villages/const.lua +++ b/mods/MAPGEN/mcl_villages/const.lua @@ -49,7 +49,7 @@ schem_path = settlements.modpath.."/schematics/" -- -- list of schematics -- -local basic_pseudobiome_villages = minetest.settings:get_bool("basic_pseudobiome_villages", false) +local basic_pseudobiome_villages = minetest.settings:get_bool("basic_pseudobiome_villages", true) 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 }, diff --git a/mods/MAPGEN/mcl_villages/convert_lua_mts.lua b/mods/MAPGEN/mcl_villages/convert_lua_mts.lua deleted file mode 100644 index cf30e00666..0000000000 --- a/mods/MAPGEN/mcl_villages/convert_lua_mts.lua +++ /dev/null @@ -1,29 +0,0 @@ --- -function settlements.convert_mts_to_lua() - local building = schem_path.."townhall.mts" - local str = minetest.serialize_schematic(building, "lua", {lua_use_comments = true, lua_num_indent_spaces = 0}).." return(schematic)" - local schematic = loadstring(str)() - local file = io.open(schem_path.."church"..".lua", "w") - file:write(dump(schematic)) - file:close() - print(dump(schematic)) -end - - -function settlements.mts_save() - local f = assert(io.open(schem_path.."hut.lua", "r")) - local content = f:read("*all").." return(schematic2)" - f:close() - - local schematic2 = loadstring("schematic2 = "..content)() - local seb = minetest.serialize_schematic(schematic2, "mts", {}) - local filename = schem_path .. "hut2" .. ".mts" - filename = filename:gsub("\"", "\\\""):gsub("\\", "\\\\") - local file, err = io.open(filename, "wb") - if err == nil and seb then - file:write(seb) - file:flush() - file:close() - end - print("Wrote: " .. filename) -end diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index 61e370d584..5ee3b054ad 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -72,26 +72,29 @@ local function ecb_build_a_settlement(blockpos, action, calls_remaining, param) end end -minetest.register_on_generated(function(minp, maxp, blockseed) - -- needed for manual and automated settlement building - local heightmap = minetest.get_mapgen_object("heightmap") +-- Disable natural generation in singlenode. +local mg_name = minetest.get_mapgen_setting("mg_name") +if mg_name ~= "singlenode" then + minetest.register_on_generated(function(minp, maxp, blockseed) + -- needed for manual and automated settlement building + local heightmap = minetest.get_mapgen_object("heightmap") - -- randomly try to build settlements - if blockseed % 77 ~= 17 then return end + -- randomly try to build settlements + if blockseed % 77 ~= 17 then return end - -- don't build settlement underground - if maxp.y < 0 then return end + -- don't build settlement underground + if maxp.y < 0 then return end - -- don't build settlements on (too) uneven terrain - local height_difference = settlements.evaluate_heightmap(minp, maxp) - if height_difference > max_height_difference then return end - - -- new way - slow :((((( - minetest.emerge_area(vector.subtract(minp,24), vector.add(maxp,24), ecb_build_a_settlement, {minp = vector.new(minp), maxp=vector.new(maxp), blockseed=blockseed}) - -- old way - wait 3 seconds: - -- minetest.after(3, ecb_build_a_settlement, nil, 1, 0, {minp = vector.new(minp), maxp=vector.new(maxp), blockseed=blockseed}) -end) + -- don't build settlements on (too) uneven terrain + local height_difference = settlements.evaluate_heightmap(minp, maxp) + if height_difference > max_height_difference then return end + -- new way - slow :((((( + minetest.emerge_area(vector.subtract(minp,24), vector.add(maxp,24), ecb_build_a_settlement, {minp = vector.new(minp), maxp=vector.new(maxp), blockseed=blockseed}) + -- old way - wait 3 seconds: + -- minetest.after(3, ecb_build_a_settlement, nil, 1, 0, {minp = vector.new(minp), maxp=vector.new(maxp), blockseed=blockseed}) + end) +end -- manually place villages if minetest.is_creative_enabled("") then minetest.register_craftitem("mcl_villages:tool", { diff --git a/settingtypes.txt b/settingtypes.txt index d41ff369ce..394749fd71 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -130,8 +130,8 @@ mcl_superflat_classic (Classic superflat map generation) bool false # game by a lot. mcl_node_particles (Block particles detail level) enum none high,medium,low,none -# If enabled, this will substitute a few blocks in village schematics so they blend into normal, snowy, and sandy areas. Defaults to false. -basic_pseudobiome_villages (Enables very basic, and experimental "pseudobiome-based" villages) bool false +# If enabled, this will substitute a few blocks in village schematics so they blend into normal, snowy, and sandy areas. Defaults to true. +basic_pseudobiome_villages (Enables very basic, and experimental "pseudobiome-based" villages) bool true # If enabled, will run an LBM to fix the top 1/2 of double plants in mcimported worlds; defaults to true. fix_doubleplants (Mcimport double plant fixes) bool true