diff --git a/mods/CORE/mcl_mapgen/init.lua b/mods/CORE/mcl_mapgen/init.lua index 3d5d1a817..1efde8bcf 100644 --- a/mods/CORE/mcl_mapgen/init.lua +++ b/mods/CORE/mcl_mapgen/init.lua @@ -20,7 +20,7 @@ local function unsigned(v) return v % 0x100000000 end -if not bit then +if bit == nil then bit = {} function bit.bxor(a, b) local a = unsigned(a) @@ -38,8 +38,14 @@ if not bit then end end -if not vector.metatable then - dofile(minetest.get_modpath(minetest.get_current_modname() .. "/vector.lua")) +if vector.metatable == nil then + function math.round(x) + if x >= 0 then + return math.floor(x + 0.5) + end + return math.ceil(x - 0.5) + end + dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/vector.lua") end -- End of compatibility stuff diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index fcd54174d..55b1df887 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -436,8 +436,7 @@ local function build_a_village(minp, maxp, pr, placer) end -- Disable natural generation in singlenode. -if mg_name ~= "singlenode" then - local mg_name = minetest.get_mapgen_setting("mg_name") +if mcl_mapgen.name ~= "singlenode" then local scan_last_node = mcl_mapgen.LAST_BLOCK * mcl_mapgen.BS - 1 local scan_offset = mcl_mapgen.BS mcl_mapgen.register_mapgen(function(minp, maxp, chunkseed)