From c23bb1d59dbcba9a1d1ba678591f1cdd4e620ccd Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 28 Apr 2021 03:03:47 +0400 Subject: [PATCH] [mapgen] rebalance mapgen/init core code --- mods/CORE/mcl_mapgen/init.lua | 166 ++++++------ mods/CORE/mcl_worlds/init.lua | 32 +-- mods/ENTITIES/mobs_mc_gameconfig/init.lua | 12 +- mods/ITEMS/mcl_portals/portal_nether.lua | 16 +- mods/MAPGEN/mcl_biomes/init.lua | 306 +++++++++++----------- mods/MAPGEN/mcl_biomes/mod.conf | 2 +- mods/MAPGEN/mcl_dungeons/init.lua | 6 +- mods/MAPGEN/mcl_mapgen_core/init.lua | 88 +++---- mods/MAPGEN/mcl_structures/init.lua | 6 +- mods/MAPGEN/mcl_villages/buildings.lua | 4 +- mods/MAPGEN/mcl_villages/utils.lua | 2 +- mods/MAPGEN/tsm_railcorridors/init.lua | 2 +- 12 files changed, 316 insertions(+), 326 deletions(-) diff --git a/mods/CORE/mcl_mapgen/init.lua b/mods/CORE/mcl_mapgen/init.lua index f5c6a16f9..74461a5fa 100644 --- a/mods/CORE/mcl_mapgen/init.lua +++ b/mods/CORE/mcl_mapgen/init.lua @@ -1,12 +1,17 @@ mcl_mapgen = {} +mcl_mapgen.overworld = {} +mcl_mapgen.nether = {} +mcl_mapgen.end = {} +local minetest_log, math_floor = minetest.log, math.floor +local minetest_get_node = minetest.get_node -- Calculate mapgen_edge_min/mapgen_edge_max mcl_mapgen.CS = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5) mcl_mapgen.BS = math.max(1, core.MAP_BLOCKSIZE or 16) mcl_mapgen.LIMIT = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000) mcl_mapgen.MAX_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000) -mcl_mapgen.OFFSET = - math.floor(mcl_mapgen.CS / 2) +mcl_mapgen.OFFSET = - math_floor(mcl_mapgen.CS / 2) mcl_mapgen.OFFSET_NODES = mcl_mapgen.OFFSET * mcl_mapgen.BS mcl_mapgen.CS_NODES = mcl_mapgen.CS * mcl_mapgen.BS @@ -16,15 +21,17 @@ local central_chunk_max_pos = central_chunk_min_pos + mcl_mapgen.CS_NODES - 1 local ccfmin = central_chunk_min_pos - mcl_mapgen.BS -- Fullminp/fullmaxp of central chunk, in nodes local ccfmax = central_chunk_max_pos + mcl_mapgen.BS -local mapgen_limit_b = math.floor(math.min(mcl_mapgen.LIMIT, mcl_mapgen.MAX_LIMIT) / mcl_mapgen.BS) +local mapgen_limit_b = math_floor(math.min(mcl_mapgen.LIMIT, mcl_mapgen.MAX_LIMIT) / mcl_mapgen.BS) local mapgen_limit_min = - mapgen_limit_b * mcl_mapgen.BS local mapgen_limit_max = (mapgen_limit_b + 1) * mcl_mapgen.BS - 1 -local numcmin = math.max(math.floor((ccfmin - mapgen_limit_min) / mcl_vars.chunk_size_in_nodes), 0) -- Number of complete chunks from central chunk -local numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / mcl_vars.chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits. +local numcmin = math.max(math_floor((ccfmin - mapgen_limit_min) / mcl_mapgen.CS_NODES), 0) -- Number of complete chunks from central chunk +local numcmax = math.max(math_floor((mapgen_limit_max - ccfmax) / mcl_mapgen.CS_NODES), 0) -- fullminp/fullmaxp to effective mapgen limits. mcl_mapgen.EDGE_MIN = central_chunk_min_pos - numcmin * mcl_mapgen.CS_NODES mcl_mapgen.EDGE_MAX = central_chunk_max_pos + numcmax * mcl_mapgen.CS_NODES + +minetest_log("action", "[mcl_mapgen] World edges are: mcl_mapgen.EDGE_MIN = " .. tostring(mcl_mapgen.EDGE_MIN) .. ", mcl_mapgen.EDGE_MAX = " .. tostring(mcl_mapgen.EDGE_MAX)) ------------------------------------------ @@ -33,12 +40,10 @@ local lvm, block, lvm_block, lvm_chunk, param2, nodes_block, nodes_chunk = 0, 0, local lvm_buffer, lvm_param2_buffer = {}, {} -- Static buffer pointers local BS, CS = mcl_mapgen.BS, mcl_mapgen.CS -- Mapblock size (in nodes), Mapchunk size (in blocks) local LAST_BLOCK, LAST_NODE = CS - 1, BS - 1 -- First mapblock in chunk (node in mapblock) has number 0, last has THIS number. It's for runtime optimization -local offset = math.floor(mcl_vars.central_chunk_offset_in_nodes / BS) -- Central mapchunk offset (in blocks) +local offset = mcl_mapgen.OFFSET -- Central mapchunk offset (in blocks) local DEFAULT_PRIORITY = 5000 -local minetest_log, math_floor = minetest.log, math.floor - function mcl_mapgen.register_chunk_generator(callback_function, priority) nodes_chunk = nodes_chunk + 1 node_chunk_queue[nodes_chunk] = {i = priority or DEFAULT_PRIORITY, f = callback_function} @@ -141,15 +146,17 @@ minetest.register_on_generated(function(minp, maxp, blockseed) end end - if vm_context.write then - vm:set_data(data) + if lvm > 0 then + if vm_context.write then + vm:set_data(data) + end + if vm_context.write_param2 then + vm:set_param2_data(data2) + end + vm:calc_lighting(minp, maxp, vm_context.shadow) -- TODO: check boundaries + vm:write_to_map() + vm:update_liquids() end - if vm_context.write_param2 then - vm:set_param2_data(data2) - end - vm:calc_lighting(p1, p2, shadow) - vm:write_to_map() - vm:update_liquids() for _, v in pairs(node_chunk_queue) do v.f(minp, maxp, blockseed) @@ -174,11 +181,11 @@ function mcl_mapgen.get_far_node(p) end local function coordinate_to_block(x) - return math_floor(x / mcl_mapgen.BS) + return math_floor(x / BS) end local function coordinate_to_chunk(x) - return math_floor((coordinate_to_block(x) - central_chunk_offset) / mcl_mapgen.CS) + return math_floor((coordinate_to_block(x) - offset) / CS) end function mcl_mapgen.pos_to_block(pos) @@ -197,7 +204,7 @@ function mcl_mapgen.pos_to_chunk(pos) } end -local k_positive = math.ceil(mcl_mapgen.MAX_LIMIT / mcl_vars.chunk_size_in_nodes) +local k_positive = math.ceil(mcl_mapgen.MAX_LIMIT / mcl_mapgen.CS_NODES) local k_positive_z = k_positive * 2 local k_positive_y = k_positive_z * k_positive_z @@ -210,96 +217,79 @@ function mcl_mapgen.get_chunk_number(pos) -- unsigned int end - - - -- Mapgen variables -local mg_name = minetest.get_mapgen_setting("mg_name") -local minecraft_height_limit = 256 -local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true" -local singlenode = mg_name == "singlenode" +mcl_mapgen.name = minetest.get_mapgen_setting("mg_name") +mcl_mapgen.superflat = mcl_mapgen.name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true" +mcl_mapgen.singlenode = mcl_mapgen.name == "singlenode" +mcl_mapgen.normal = not mcl_mapgen.superflat and not mcl_mapgen.singlenode +local superflat, singlenode, normal = mcl_mapgen.superflat, mcl_mapgen.singlenode, mcl_mapgen.normal -if not superflat and not singlenode then - -- Normal mode - --[[ Realm stacking (h is for height) - - Overworld (h>=256) - - Void (h>=1000) - - Realm Barrier (h=11), to allow escaping the End - - End (h>=256) - - Void (h>=1000) - - Nether (h=128) - - Void (h>=1000) - ]] +minetest_log("action", "[mcl_mapgen] Mapgen mode: " .. normal and "normal" or (superflat and "superflat" or "singlenode")) - -- Overworld - mcl_vars.mg_overworld_min = -62 - mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit - mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min - mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min + 4 - mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min + 10 - mcl_vars.mg_lava = true - mcl_vars.mg_bedrock_is_rough = true +mcl_mapgen.minecraft_height_limit = 256 -elseif singlenode then - mcl_vars.mg_overworld_min = -66 - mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit - mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min - mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min - mcl_vars.mg_lava = false - mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min - mcl_vars.mg_bedrock_is_rough = false -else - -- Classic superflat - local ground = minetest.get_mapgen_setting("mgflat_ground_level") - ground = tonumber(ground) - if not ground then - ground = 8 - end - mcl_vars.mg_overworld_min = ground - 3 - mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit - mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min - mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min - mcl_vars.mg_lava = false - mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min - mcl_vars.mg_bedrock_is_rough = false +mcl_mapgen.bedrock_is_rough = normal + +--[[ Realm stacking (h is for height) +- Overworld (h>=256) +- Void (h>=1000) +- Realm Barrier (h=11), to allow escaping the End +- End (h>=256) +- Void (h>=1000) +- Nether (h=128) +- Void (h>=1000) +]] + +-- Overworld +mcl_mapgen.overworld.min = -62 +if superflat then + mcl_mapgen.ground = tonumber(minetest.get_mapgen_setting("mgflat_ground_level")) or 8 + mcl_mapgen.overworld.min = ground - 3 end +-- if singlenode then mcl_mapgen.overworld.min = -66 end -- DONT KNOW WHY +mcl_mapgen.overworld.max = mcl_mapgen.EDGE_MAX + +mcl_mapgen.overworld.bedrock_min = mcl_mapgen.overworld.min +mcl_mapgen.overworld.bedrock_max = mcl_mapgen.overworld.bedrock_min + (mcl_mapgen.bedrock_is_rough and 4 or 0) + +mcl_mapgen.lava = normal +mcl_mapgen.lava_overworld_max = mcl_mapgen.overworld.min + (normal and 10 or 0) -mcl_vars.mg_overworld_max = mcl_mapgen.EDGE_MAX -- The Nether (around Y = -29000) -mcl_vars.mg_nether_min = -29067 -- Carefully chosen to be at a mapchunk border -mcl_vars.mg_nether_max = mcl_vars.mg_nether_min + 128 -mcl_vars.mg_bedrock_nether_bottom_min = mcl_vars.mg_nether_min -mcl_vars.mg_bedrock_nether_top_max = mcl_vars.mg_nether_max +mcl_mapgen.nether.min = -29067 -- Carefully chosen to be at a mapchunk border +mcl_mapgen.nether.max = mcl_mapgen.nether.min + 128 +mcl_mapgen.nether.bedrock_bottom_min = mcl_mapgen.nether.min +mcl_mapgen.nether.bedrock_top_max = mcl_mapgen.nether.max if not superflat then - mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4 - mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - 4 - mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 31 + mcl_mapgen.nether.bedrock_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4 + mcl_mapgen.nether.bedrock_top_min = mcl_vars.mg_bedrock_nether_top_max - 4 + mcl_mapgen.nether.lava_max = mcl_mapgen.nether.min + 31 else -- Thin bedrock in classic superflat mapgen - mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min - mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - mcl_vars.mg_lava_nether_max = mcl_vars.mg_nether_min + 2 + mcl_mapgen.nether.bedrock_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + mcl_mapgen.nether.bedrock_top_min = mcl_vars.mg_bedrock_nether_top_max + mcl_mapgen.nether.lava_max = mcl_mapgen.nether.min + 2 end -if mg_name == "flat" then +if mcl_mapgen.name == "flat" then if superflat then - mcl_vars.mg_flat_nether_floor = mcl_vars.mg_bedrock_nether_bottom_max + 4 - mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_bedrock_nether_bottom_max + 52 + mcl_mapgen.nether.flat_nether_floor = mcl_mapgen.nether.bedrock_nether_bottom_max + 4 + mcl_mapgen.nether.flat_nether_ceiling = mcl_mapgen.nether.bedrock_nether_bottom_max + 52 else - mcl_vars.mg_flat_nether_floor = mcl_vars.mg_lava_nether_max + 4 - mcl_vars.mg_flat_nether_ceiling = mcl_vars.mg_lava_nether_max + 52 + mcl_mapgen.nether.flat_nether_floor = mcl_mapgen.nether.lava_nether_max + 4 + mcl_mapgen.nether.flat_nether_ceiling = mcl_mapgen.nether.lava_nether_max + 52 end end -- The End (surface at ca. Y = -27000) -mcl_vars.mg_end_min = -27073 -- Carefully chosen to be at a mapchunk border -mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit -mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000 -mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 } +mcl_mapgen.end.min = -27073 -- Carefully chosen to be at a mapchunk border +mcl_mapgen.end.max_official = mcl_mapgen.end.min + mcl_mapgen.minecraft_height_limit +mcl_mapgen.end.max = mcl_mapgen.overworld.min - 2000 +mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_mapgen.end.min + 74, z = 0 } -- Realm barrier used to safely separate the End from the void below the Overworld -mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max -mcl_vars.mg_realm_barrier_overworld_end_min = mcl_vars.mg_end_max - 11 +mcl_vars.mg_realm_barrier_overworld_end_max = mcl_mapgen.end.max +mcl_vars.mg_realm_barrier_overworld_end_min = mcl_mapgen.end.max - 11 -- Use MineClone 2-style dungeons mcl_vars.mg_dungeons = true diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index 6cdeaab7e..a9d9ea050 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -3,25 +3,25 @@ mcl_worlds = {} -- For a given position, returns a 2-tuple: -- 1st return value: true if pos is in void -- 2nd return value: true if it is in the deadly part of the void +local min1, min2, min3 = mcl_mapgen.overworld.min, mcl_mapgen.end.min, mcl_mapgen.nether.min +local max1, max2, max3 = mcl_mapgen.overworld.max, mcl_mapgen.end.max, mcl_mapgen.nether.max+128 function mcl_worlds.is_in_void(pos) - local void = - not ((pos.y < mcl_vars.mg_overworld_max and pos.y > mcl_vars.mg_overworld_min) or - (pos.y < mcl_vars.mg_nether_max+128 and pos.y > mcl_vars.mg_nether_min) or - (pos.y < mcl_vars.mg_end_max and pos.y > mcl_vars.mg_end_min)) + local y = pos.y + local void = not ((y < max1 and y > min1) or (y < max2 and y > min2) or (y < max3 and y > min3)) local void_deadly = false local deadly_tolerance = 64 -- the player must be this many nodes “deep” into the void to be damaged if void then -- Overworld → Void → End → Void → Nether → Void - if pos.y < mcl_vars.mg_overworld_min and pos.y > mcl_vars.mg_end_max then - void_deadly = pos.y < mcl_vars.mg_overworld_min - deadly_tolerance - elseif pos.y < mcl_vars.mg_end_min and pos.y > mcl_vars.mg_nether_max+128 then + if y < mcl_vars.min1 and y > max2 then + void_deadly = y < min1 - deadly_tolerance + elseif y < min2 and y > max3 then -- The void between End and Nether. Like usual, but here, the void -- *above* the Nether also has a small tolerance area, so player -- can fly above the Nether without getting hurt instantly. - void_deadly = (pos.y < mcl_vars.mg_end_min - deadly_tolerance) and (pos.y > mcl_vars.mg_nether_max+128 + deadly_tolerance) - elseif pos.y < mcl_vars.mg_nether_min then - void_deadly = pos.y < mcl_vars.mg_nether_min - deadly_tolerance + void_deadly = (y < min2 - deadly_tolerance) and (y > max3 + deadly_tolerance) + elseif y < min3 then + void_deadly = y < min3 - deadly_tolerance end end return void, void_deadly @@ -33,12 +33,12 @@ end -- If the Y coordinate is not located in any dimension, it will return: -- nil, "void" function mcl_worlds.y_to_layer(y) - if y >= mcl_vars.mg_overworld_min then - return y - mcl_vars.mg_overworld_min, "overworld" - elseif y >= mcl_vars.mg_nether_min and y <= mcl_vars.mg_nether_max+128 then - return y - mcl_vars.mg_nether_min, "nether" - elseif y >= mcl_vars.mg_end_min and y <= mcl_vars.mg_end_max then - return y - mcl_vars.mg_end_min, "end" + if y >= min1 then + return y - min1, "overworld" + elseif y >= min3 and y <= max3 then + return y - min3, "nether" + elseif y >= min2 and y <= max2 then + return y - min2, "end" else return nil, "void" end diff --git a/mods/ENTITIES/mobs_mc_gameconfig/init.lua b/mods/ENTITIES/mobs_mc_gameconfig/init.lua index 06d7eb87f..dd310c1b3 100644 --- a/mods/ENTITIES/mobs_mc_gameconfig/init.lua +++ b/mods/ENTITIES/mobs_mc_gameconfig/init.lua @@ -233,15 +233,15 @@ mobs_mc.override.spawn_height = { water = tonumber(minetest.settings:get("water_level")) or 0, -- Water level in the Overworld -- Overworld boundaries (inclusive) - overworld_min = mcl_vars.mg_overworld_min, - overworld_max = mcl_vars.mg_overworld_max, + overworld_min = mcl_mapgen.overworld.min, + overworld_max = mcl_mapgen.overworld.max, -- Nether boundaries (inclusive) - nether_min = mcl_vars.mg_nether_min, - nether_max = mcl_vars.mg_nether_max, + nether_min = mcl_mapgen.nether.min, + nether_max = mcl_mapgen.nether.max, -- End boundaries (inclusive) - end_min = mcl_vars.mg_end_min, - end_max = mcl_vars.mg_end_max, + end_min = mcl_mapgen.end.min, + end_max = mcl_mapgen.end.max, } diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 7fd0191fa..ee38264da 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -27,7 +27,7 @@ local DELAY = 3 -- seconds before teleporting in Nether portal in Survival mo local DISTANCE_MAX = 128 local PORTAL = "mcl_portals:portal" local OBSIDIAN = "mcl_core:obsidian" -local O_Y_MIN, O_Y_MAX = max(mcl_vars.mg_overworld_min, -31), min(mcl_vars.mg_overworld_max, 2048) +local O_Y_MIN, O_Y_MAX = max(mcl_mapgen.overworld.min, -31), min(mcl_mapgen.overworld.max, 2048) local N_Y_MIN, N_Y_MAX = mcl_vars.mg_bedrock_nether_bottom_min, mcl_vars.mg_bedrock_nether_top_min - H_MIN -- Alpha and particles @@ -66,7 +66,7 @@ minetest.register_on_shutdown(function() storage:set_string("nether_exits_keys", minetest.serialize(keys)) end) -local get_node = mcl_vars.get_node +local get_node = mcl_mapgen.get_far_node local set_node = minetest.set_node local registered_nodes = minetest.registered_nodes local is_protected = minetest.is_protected @@ -414,7 +414,7 @@ local function create_portal_2(pos1, name, obj) end local exit = build_nether_portal(pos1, W_MIN-2, H_MIN-2, orientation, name) finalize_teleport(obj, exit) - local cn = mcl_vars.get_chunk_number(pos1) + local cn = mcl_mapgen.get_chunk_number(pos1) chunks[cn] = nil if queue[cn] then for next_obj, _ in pairs(queue[cn]) do @@ -428,9 +428,9 @@ end local function get_lava_level(pos, pos1, pos2) if pos.y > -1000 then - return max(min(mcl_vars.mg_lava_overworld_max, pos2.y-1), pos1.y+1) + return max(min(mcl_mapgen.overworld.lava_max, pos2.y-1), pos1.y+1) end - return max(min(mcl_vars.mg_lava_nether_max, pos2.y-1), pos1.y+1) + return max(min(mcl_mapgen.nether.lava_max, pos2.y-1), pos1.y+1) end local function ecb_scan_area_2(blockpos, action, calls_remaining, param) @@ -509,7 +509,7 @@ local function ecb_scan_area_2(blockpos, action, calls_remaining, param) end local function create_portal(pos, limit1, limit2, name, obj) - local cn = mcl_vars.get_chunk_number(pos) + local cn = mcl_mapgen.get_chunk_number(pos) if chunks[cn] then local q = queue[cn] or {} q[obj] = true @@ -537,8 +537,8 @@ local function create_portal(pos, limit1, limit2, name, obj) end -- Basically the copy of code above, with minor additions to continue the search in single additional chunk below: - local next_chunk_1 = {x = pos1.x, y = pos1.y - mcl_vars.chunk_size_in_nodes, z = pos1.z} - local next_chunk_2 = add(next_chunk_1, mcl_vars.chunk_size_in_nodes - 1) + local next_chunk_1 = {x = pos1.x, y = pos1.y - mcl_mapgen.CS_NODES, z = pos1.z} + local next_chunk_2 = add(next_chunk_1, mcl_mapgen.CS_NODES - 1) local next_pos = {x = pos.x, y=max(next_chunk_2.y, limit1.y), z = pos.z} if limit1 and limit1.x and limit1.y and limit1.z then pos1 = {x = max(min(limit1.x, pos.x), pos1.x), y = max(min(limit1.y, pos.y), pos1.y), z = max(min(limit1.z, pos.z), pos1.z)} diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 9facd83b3..3cfeea048 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -32,8 +32,8 @@ local function register_classic_superflat_biome() node_filler = "mcl_core:dirt", depth_filler = 3, node_stone = "mcl_core:dirt", - y_min = mcl_vars.mg_overworld_min - 512, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min - 512, + y_max = mcl_mapgen.overworld.max, humidity_point = 50, heat_point = 50, _mcl_biome_type = "medium", @@ -136,7 +136,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 24, heat_point = -5, _mcl_biome_type = "snowy", @@ -170,7 +170,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 58, heat_point = 8, _mcl_biome_type = "snowy", @@ -241,7 +241,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 76, heat_point = 10, _mcl_biome_type = "cold", @@ -273,7 +273,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 100, heat_point = 8, _mcl_biome_type = "cold", @@ -306,7 +306,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 4, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 10, heat_point = 45, _mcl_biome_type = "cold", @@ -356,7 +356,7 @@ local function register_biomes() node_riverbed = "mcl_core:gravel", depth_riverbed = 3, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 0, heat_point = 25, _mcl_biome_type = "cold", @@ -409,7 +409,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 4, y_min = 42, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 24, heat_point = 25, _mcl_biome_type = "cold", @@ -439,7 +439,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 1, y_min = -7, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 0, heat_point = 8, _mcl_biome_type = "cold", @@ -475,7 +475,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 24, heat_point = 8, _mcl_biome_type = "snowy", @@ -507,7 +507,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 39, heat_point = 58, _mcl_biome_type = "medium", @@ -554,7 +554,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 28, heat_point = 45, _mcl_biome_type = "medium", @@ -586,7 +586,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 58, heat_point = 22, _mcl_biome_type = "cold", @@ -633,7 +633,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 61, heat_point = 45, _mcl_biome_type = "medium", @@ -680,7 +680,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 44, heat_point = 32, _mcl_biome_type = "medium", @@ -727,7 +727,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 78, heat_point = 31, _mcl_biome_type = "medium", @@ -759,7 +759,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 77, heat_point = 27, _mcl_biome_type = "medium", @@ -792,7 +792,7 @@ local function register_biomes() depth_riverbed = 2, node_stone = "mcl_core:sandstone", y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 26, heat_point = 94, _mcl_biome_type = "hot", @@ -824,7 +824,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 94, heat_point = 27, _mcl_biome_type = "medium", @@ -857,7 +857,7 @@ local function register_biomes() depth_riverbed = 1, node_stone = "mcl_colorblocks:hardened_clay", y_min = 11, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 0, heat_point = 100, _mcl_biome_type = "hot", @@ -907,7 +907,7 @@ local function register_biomes() depth_riverbed = 1, node_stone = "mcl_colorblocks:hardened_clay", y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = -5, heat_point = 100, _mcl_biome_type = "hot", @@ -979,7 +979,7 @@ local function register_biomes() depth_riverbed = 1, node_stone = "mcl_colorblocks:hardened_clay", y_min = 30, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 0, heat_point = 60, _mcl_biome_type = "hot", @@ -1049,7 +1049,7 @@ local function register_biomes() depth_riverbed = 1, node_stone = "mcl_colorblocks:hardened_clay", y_min = 30, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = -5, heat_point = 60, _mcl_biome_type = "hot", @@ -1101,7 +1101,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 36, heat_point = 79, _mcl_biome_type = "hot", @@ -1150,7 +1150,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 48, heat_point = 100, _mcl_biome_type = "hot", @@ -1182,7 +1182,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 88, heat_point = 81, _mcl_biome_type = "medium", @@ -1231,7 +1231,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 92, heat_point = 81, _mcl_biome_type = "medium", @@ -1279,7 +1279,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 88, heat_point = 76, _mcl_biome_type = "medium", @@ -1314,7 +1314,7 @@ local function register_biomes() node_riverbed = "mcl_core:sand", depth_riverbed = 2, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, humidity_point = 90, heat_point = 79, _mcl_biome_type = "medium", @@ -1464,7 +1464,7 @@ local function register_biomes() name = biome .. "_underground", heat_point = minetest.registered_biomes[biome].heat_point, humidity_point = minetest.registered_biomes[biome].humidity_point, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = DEEP_OCEAN_MIN - 1, _mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type, _mcl_palette_index = minetest.registered_biomes[biome]._mcl_palette_index, @@ -1485,10 +1485,10 @@ local function register_dimension_biomes() node_water = "air", node_river_water = "air", node_cave_liquid = "air", - y_min = mcl_vars.mg_nether_min, + y_min = mcl_mapgen.nether.min, -- FIXME: For some reason the Nether stops generating early if this constant is not added. -- Figure out why. - y_max = mcl_vars.mg_nether_max + 80, + y_max = mcl_mapgen.nether.max + 80, heat_point = 100, humidity_point = 0, _mcl_biome_type = "hot", @@ -1505,8 +1505,8 @@ local function register_dimension_biomes() node_cave_liquid = "air", -- FIXME: For some reason the End stops generating early if this constant is not added. -- Figure out why. - y_min = mcl_vars.mg_end_min, - y_max = mcl_vars.mg_end_max + 80, + y_min = mcl_mapgen.end.min, + y_max = mcl_mapgen.end.max + 80, heat_point = 50, humidity_point = 50, _mcl_biome_type = "medium", @@ -1551,7 +1551,7 @@ local function register_biome_ores() clust_scarcity = monster_egg_scarcity, clust_num_ores = 3, clust_size = 2, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(61), biomes = { "ExtremeHills", "ExtremeHills_beach", "ExtremeHills_ocean", "ExtremeHills_deep_ocean", "ExtremeHills_underground", @@ -1590,8 +1590,8 @@ local function register_biomelike_ores() clust_scarcity = 1, clust_num_ores = 12, clust_size = 10, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_threshold = 0.2, noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}, biomes = { "MegaTaiga" }, @@ -1603,8 +1603,8 @@ local function register_biomelike_ores() wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, column_height_max = 1, column_midpoint_factor = 0.0, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_threshold = 0.0, noise_params = {offset=0, scale=15, spread={x=250, y=250, z=250}, seed=24, octaves=3, persist=0.70}, biomes = { "MesaPlateauF_grasstop" }, @@ -1616,8 +1616,8 @@ local function register_biomelike_ores() clust_scarcity = 1500, clust_num_ores = 25, clust_size = 7, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -1636,8 +1636,8 @@ local function register_biomelike_ores() wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, column_height_max = 1, column_midpoint_factor = 0.0, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_threshold = -2.5, noise_params = {offset=1, scale=15, spread={x=250, y=250, z=250}, seed=24, octaves=3, persist=0.80}, biomes = { "MesaPlateauFM_grasstop" }, @@ -1649,8 +1649,8 @@ local function register_biomelike_ores() clust_scarcity = 1800, clust_num_ores = 65, clust_size = 15, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -1670,8 +1670,8 @@ local function register_biomelike_ores() wherein = {"group:hardened_clay", "group:sand","mcl_core:coarse_dirt"}, clust_scarcity = 4000, clust_size = 5, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -1690,8 +1690,8 @@ local function register_biomelike_ores() wherein = {"mcl_colorblocks:hardened_clay_orange"}, clust_scarcity = 300, clust_size = 8, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -1712,8 +1712,8 @@ local function register_biomelike_ores() clust_scarcity = 1, clust_num_ores = 12, clust_size = 10, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_threshold = 0.1, noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=95, octaves=3, persist=0.70}, biomes = { "MesaPlateauFM" }, @@ -1724,8 +1724,8 @@ local function register_biomelike_ores() wherein = {"group:hardened_clay"}, clust_scarcity = 1500, clust_size = 4, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -1748,8 +1748,8 @@ local function register_biomelike_ores() clust_scarcity = 5000, clust_num_ores = 12, clust_size = 4, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_threshold = 0.2, noise_params = {offset=0, scale=5, spread={x=250, y=250, z=250}, seed=64, octaves=3, persist=0.60}, biomes = { "ExtremeHillsM" }, @@ -1947,7 +1947,7 @@ local function register_dimension_ores() wherein = {"mcl_nether:netherrack", "mcl_core:stone"}, clust_scarcity = 13 * 13 * 13, clust_size = 5, - y_min = mcl_vars.mg_nether_min, + y_min = mcl_mapgen.nether.min, y_max = mcl_worlds.layer_to_y(64, "nether"), noise_threshold = 0.0, noise_params = { @@ -2010,7 +2010,7 @@ local function register_dimension_ores() clust_scarcity = 26 * 26 * 26, clust_size = 5, y_min = mcl_vars.mg_lava_nether_max + 10, - y_max = mcl_vars.mg_nether_max, + y_max = mcl_mapgen.nether.max, noise_threshold = 0.0, noise_params = { offset = 0.5, @@ -2053,8 +2053,8 @@ local function register_dimension_ores() clust_scarcity = 850, clust_num_ores = 4, -- MC cluster amount: 4-10 clust_size = 3, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_max, + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max, }) minetest.register_ore({ ore_type = "scatter", @@ -2063,8 +2063,8 @@ local function register_dimension_ores() clust_scarcity = 1650, clust_num_ores = 8, -- MC cluster amount: 4-10 clust_size = 4, - y_min = mcl_vars.mg_nether_min, - y_max = mcl_vars.mg_nether_max, + y_min = mcl_mapgen.nether.min, + y_max = mcl_mapgen.nether.max, }) end @@ -2076,7 +2076,7 @@ local function register_dimension_ores() clust_scarcity = 500, clust_num_ores = 1, clust_size = 1, - y_min = mcl_vars.mg_nether_min, + y_min = mcl_mapgen.nether.min, y_max = mcl_vars.mg_lava_nether_max + 1, }) @@ -2109,7 +2109,7 @@ local function register_dimension_ores() clust_num_ores = 1, clust_size = 1, y_min = mcl_vars.mg_lava_nether_max + 49, - y_max = mcl_vars.mg_nether_max, + y_max = mcl_mapgen.nether.max, }) --[[ THE END ]] @@ -2129,11 +2129,11 @@ local function register_dimension_ores() ore_type = "stratum", ore = "mcl_end:end_stone", wherein = end_wherein, - y_min = mcl_vars.mg_end_min+64, - y_max = mcl_vars.mg_end_min+80, + y_min = mcl_mapgen.end.min+64, + y_max = mcl_mapgen.end.min+80, noise_params = { - offset = mcl_vars.mg_end_min+70, + offset = mcl_mapgen.end.min+70, scale = -1, spread = {x=126, y=126, z=126}, seed = mg_seed+9999, @@ -2156,11 +2156,11 @@ local function register_dimension_ores() ore_type = "stratum", ore = "mcl_end:end_stone", wherein = end_wherein, - y_min = mcl_vars.mg_end_min+64, - y_max = mcl_vars.mg_end_min+80, + y_min = mcl_mapgen.end.min+64, + y_max = mcl_mapgen.end.min+80, noise_params = { - offset = mcl_vars.mg_end_min+72, + offset = mcl_mapgen.end.min+72, scale = -3, spread = {x=84, y=84, z=84}, seed = mg_seed+999, @@ -2182,11 +2182,11 @@ local function register_dimension_ores() ore_type = "stratum", ore = "mcl_end:end_stone", wherein = end_wherein, - y_min = mcl_vars.mg_end_min+64, - y_max = mcl_vars.mg_end_min+80, + y_min = mcl_mapgen.end.min+64, + y_max = mcl_mapgen.end.min+80, noise_params = { - offset = mcl_vars.mg_end_min+70, + offset = mcl_mapgen.end.min+70, scale = -2, spread = {x=84, y=84, z=84}, seed = mg_seed+99, @@ -2239,7 +2239,7 @@ local function register_grass_decoration(grasstype, offset, scale, biomes) noise_params = noise, biomes = { biomes[b] }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = node, param2 = param2, }) @@ -2306,7 +2306,7 @@ local function register_decorations() }, biomes = {"IcePlainsSpikes"}, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_ice_spike_large.mts", rotation = "random", flags = "place_center_x, place_center_z", @@ -2327,7 +2327,7 @@ local function register_decorations() }, biomes = {"IcePlainsSpikes"}, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_ice_spike_small.mts", rotation = "random", flags = "place_center_x, place_center_z", @@ -2350,7 +2350,7 @@ local function register_decorations() }, biomes = {"Forest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_large_"..i..".mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2370,7 +2370,7 @@ local function register_decorations() }, biomes = {"ExtremeHills", "ExtremeHillsM", "ExtremeHills+", "ExtremeHills+_snowtop"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_large_"..i..".mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2391,7 +2391,7 @@ local function register_decorations() }, biomes = {"Forest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2410,7 +2410,7 @@ local function register_decorations() }, biomes = {"FlowerForest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2429,7 +2429,7 @@ local function register_decorations() }, biomes = {"ExtremeHills", "ExtremeHillsM", "ExtremeHills+", "ExtremeHills+_snowtop"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2449,7 +2449,7 @@ local function register_decorations() }, biomes = {"ExtremeHills+", "ExtremeHills+_snowtop"}, y_min = 50, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2468,7 +2468,7 @@ local function register_decorations() }, biomes = {"MesaPlateauF_grasstop"}, y_min = 30, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2487,7 +2487,7 @@ local function register_decorations() }, biomes = {"MesaPlateauFM_grasstop"}, y_min = 30, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2507,7 +2507,7 @@ local function register_decorations() }, biomes = {"IcePlains"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2519,7 +2519,7 @@ local function register_decorations() fill_ratio = 0.004, biomes = {"Jungle", "JungleM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2531,7 +2531,7 @@ local function register_decorations() fill_ratio = 0.0004, biomes = {"JungleEdge", "JungleEdgeM", "Savanna"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2553,7 +2553,7 @@ local function register_decorations() }, biomes = {"Forest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_balloon.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2574,7 +2574,7 @@ local function register_decorations() }, biomes = {"Swampland", "Swampland_shore"}, y_min = 0, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_swamp.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2591,7 +2591,7 @@ local function register_decorations() fill_ratio = 0.00125, biomes = {"Jungle"}, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree_huge_"..i..".mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2603,7 +2603,7 @@ local function register_decorations() fill_ratio = 0.004, biomes = {"JungleM"}, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree_huge_"..i..".mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2618,7 +2618,7 @@ local function register_decorations() fill_ratio = 0.045, biomes = {"Jungle"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2630,7 +2630,7 @@ local function register_decorations() fill_ratio = 0.0045, biomes = {"JungleEdge", "JungleEdgeM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2643,7 +2643,7 @@ local function register_decorations() fill_ratio = 0.09, biomes = {"JungleM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2668,7 +2668,7 @@ local function register_decorations() }, biomes = biomes, y_min = y, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/"..sprucename, flags = "place_center_x, place_center_z", }) @@ -2722,7 +2722,7 @@ local function register_decorations() }, biomes = {"Taiga", "ColdTaiga"}, y_min = 2, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_spruce_lollipop.mts", flags = "place_center_x, place_center_z", }) @@ -2742,7 +2742,7 @@ local function register_decorations() }, biomes = {"Taiga", "ColdTaiga"}, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_spruce_matchstick.mts", flags = "place_center_x, place_center_z", }) @@ -2762,7 +2762,7 @@ local function register_decorations() }, biomes = {"IcePlains"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_spruce_5.mts", flags = "place_center_x, place_center_z", }) @@ -2776,7 +2776,7 @@ local function register_decorations() fill_ratio = 0.0002, biomes = {"Savanna", "SavannaM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_acacia_"..a..".mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2798,7 +2798,7 @@ local function register_decorations() }, biomes = {"BirchForest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_birch.mts", flags = "place_center_x, place_center_z", }) @@ -2816,7 +2816,7 @@ local function register_decorations() }, biomes = {"BirchForestM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_birch_tall.mts", flags = "place_center_x, place_center_z", }) @@ -2835,7 +2835,7 @@ local function register_decorations() }, biomes = {"Forest", "FlowerForest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_birch.mts", flags = "place_center_x, place_center_z", }) @@ -2855,7 +2855,7 @@ local function register_decorations() }, biomes = {"RoofedForest"}, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_dark_oak.mts", flags = "place_center_x, place_center_z", rotation = "random", @@ -2877,7 +2877,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_huge, biomes = { "RoofedForest" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_huge_brown.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2889,7 +2889,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_giant, biomes = { "RoofedForest" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_giant_brown.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2902,7 +2902,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_mycelium_huge, biomes = { "MushroomIsland", "MushroomIslandShore" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_huge_brown.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2914,7 +2914,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_mycelium_giant, biomes = { "MushroomIsland", "MushroomIslandShore" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_giant_brown.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2928,7 +2928,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_huge, biomes = { "RoofedForest" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_huge_red.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2940,7 +2940,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_giant, biomes = { "RoofedForest" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_giant_red.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2953,7 +2953,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_mycelium_huge, biomes = { "MushroomIsland", "MushroomIslandShore" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_huge_red.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2965,7 +2965,7 @@ local function register_decorations() fill_ratio = ratio_mushroom_mycelium_giant, biomes = { "MushroomIsland", "MushroomIslandShore" }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_mushrooms").."/schematics/mcl_mushrooms_giant_red.mts", flags = "place_center_x, place_center_z", rotation = "0", @@ -2986,7 +2986,7 @@ local function register_decorations() }, biomes = {"MegaTaiga", "MegaSpruceTaiga"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_boulder.mts", flags = "place_center_x, place_center_z", }) @@ -3006,7 +3006,7 @@ local function register_decorations() }, biomes = {"MegaTaiga", "MegaSpruceTaiga"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_boulder_small.mts", flags = "place_center_x, place_center_z", }) @@ -3025,7 +3025,7 @@ local function register_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:cactus", biomes = {"Desert", "Mesa","Mesa_sandlevel", @@ -3049,7 +3049,7 @@ local function register_decorations() persist = 0.7 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:reeds", height = 1, height_max = 3, @@ -3070,7 +3070,7 @@ local function register_decorations() }, biomes = {"Swampland", "Swampland_shore"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:reeds", height = 1, height_max = 3, @@ -3104,7 +3104,7 @@ local function register_decorations() persist = 0.6, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = { biomes[b] }, }) end @@ -3139,7 +3139,7 @@ local function register_decorations() persist = 0.66, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = biomes[b], }) end @@ -3188,7 +3188,7 @@ local function register_decorations() persist = 0.62, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, flags = "", biomes = b, }) @@ -3216,7 +3216,7 @@ local function register_decorations() }, biomes = {"Jungle"}, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = jungle_bush_schematic, flags = "place_center_x, place_center_z", }) @@ -3234,7 +3234,7 @@ local function register_decorations() }, biomes = {"JungleM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = jungle_bush_schematic, flags = "place_center_x, place_center_z", }) @@ -3252,7 +3252,7 @@ local function register_decorations() }, biomes = {"JungleEdge", "JungleEdgeM"}, y_min = 3, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = jungle_bush_schematic, flags = "place_center_x, place_center_z", }) @@ -3275,7 +3275,7 @@ local function register_decorations() }, biomes = {"MegaTaiga", "MegaSpruceTaiga", "Taiga"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = {x = 3, y = 3, z = 1}, data = { @@ -3308,7 +3308,7 @@ local function register_decorations() }, biomes = {"ColdTaiga"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = {x = 3, y = 3, z = 1}, data = { @@ -3341,7 +3341,7 @@ local function register_decorations() }, biomes = {"BirchForest", "BirchForestM",}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = {x = 3, y = 3, z = 1}, data = { @@ -3367,7 +3367,7 @@ local function register_decorations() fill_ratio = 0.005, biomes = {"Jungle", "JungleM"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = {x = 3, y = 3, z = 1}, data = { @@ -3400,7 +3400,7 @@ local function register_decorations() }, biomes = {"Forest"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = {x = 3, y = 3, z = 1}, data = { @@ -3473,7 +3473,7 @@ local function register_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_farming:melon", biomes = { "Jungle" }, }) @@ -3490,7 +3490,7 @@ local function register_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_farming:melon", biomes = { "JungleM" }, }) @@ -3507,7 +3507,7 @@ local function register_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_farming:melon", biomes = { "JungleEdge", "JungleEdgeM" }, }) @@ -3526,7 +3526,7 @@ local function register_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_farming:melon", biomes = { "JungleEdgeM" }, }) @@ -3548,7 +3548,7 @@ local function register_decorations() persist = 0.666 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, }) -- Grasses and ferns @@ -3623,7 +3623,7 @@ local function register_decorations() persist = 0.666 }, flags = "force_placement", - y_min = mcl_vars.mg_lava_overworld_max + 5, + y_min = mcl_mapgen.overworld.lava_max + 5, y_max = -20, }) @@ -3642,7 +3642,7 @@ local function register_decorations() }, biomes = {"IcePlains"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = { x=1, y=2, z=1 }, data = { @@ -3665,7 +3665,7 @@ local function register_decorations() }, biomes = {"ExtremeHills+_snowtop"}, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, schematic = { size = { x=1, y=2, z=1 }, data = { @@ -3690,7 +3690,7 @@ local function register_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = {"Desert", "Mesa", "Mesa_sandlevel", "MesaPlateauF", "MesaPlateauF_sandlevel", "MesaPlateauF_grasstop","MesaBryce","Taiga", "MegaTaiga"}, decoration = "mcl_core:deadbush", height = 1, @@ -3708,7 +3708,7 @@ local function register_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = {"MesaPlateauFM_grasstop"}, decoration = "mcl_core:deadbush", height = 1, @@ -3726,7 +3726,7 @@ local function register_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = {"MesaPlateauFM","MesaPlateauFM_sandlevel"}, decoration = "mcl_core:deadbush", height = 1, @@ -3744,7 +3744,7 @@ local function register_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = {"MesaPlateauFM", "MesaPlateauFM_sandlevel", "MesaPlateauFM_grasstop"}, decoration = "mcl_core:deadbush", height = 1, @@ -3758,8 +3758,8 @@ local function register_decorations() fill_ratio = 0.009, biomes = {"MushroomIsland", "MushroomIslandShore"}, noise_threshold = 2.0, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_mushrooms:mushroom_red", }) minetest.register_decoration({ @@ -3768,8 +3768,8 @@ local function register_decorations() sidelen = 80, fill_ratio = 0.009, biomes = {"MushroomIsland", "MushroomIslandShore"}, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_mushrooms:mushroom_brown", }) @@ -3780,8 +3780,8 @@ local function register_decorations() sidelen = 80, fill_ratio = 0.003, biomes = {"Taiga", "MegaTaiga", "MegaSpruceTaiga"}, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_mushrooms:mushroom_red", }) minetest.register_decoration({ @@ -3790,8 +3790,8 @@ local function register_decorations() sidelen = 80, fill_ratio = 0.003, biomes = {"Taiga", "MegaTaiga", "MegaSpruceTaiga"}, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_mushrooms:mushroom_brown", }) @@ -3814,7 +3814,7 @@ local function register_decorations() persist = 0.66, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = mushrooms[m], spawn_by = { "mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree" }, num_spawn_by = 1, @@ -3834,7 +3834,7 @@ local function register_decorations() persist = 0.6, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = mushrooms[m], biomes = { "Swampland"}, spawn_by = { "mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree" }, @@ -3859,7 +3859,7 @@ local function register_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = biomes, decoration = "mcl_flowers:"..name, }) @@ -3878,7 +3878,7 @@ local function register_decorations() persist = 0.6, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, biomes = {"FlowerForest"}, decoration = "mcl_flowers:"..name, }) @@ -3925,8 +3925,8 @@ local function register_dimension_decorations() octaves = 3, persist = 0.6 }, - y_min = mcl_vars.mg_end_min, - y_max = mcl_vars.mg_end_max, + y_min = mcl_mapgen.end.min, + y_max = mcl_mapgen.end.max, decoration = "mcl_end:chorus_flower", height = 1, biomes = { "End" }, diff --git a/mods/MAPGEN/mcl_biomes/mod.conf b/mods/MAPGEN/mcl_biomes/mod.conf index 0c6095f3d..d389640a8 100644 --- a/mods/MAPGEN/mcl_biomes/mod.conf +++ b/mods/MAPGEN/mcl_biomes/mod.conf @@ -1,4 +1,4 @@ name = mcl_biomes author = maikerumine description = Adds the various biomes and biome-related things for non-v6 map generators. -depends = mcl_init, mcl_mapgen_core, mcl_core, mcl_worlds, mcl_farming, mcl_flowers, mcl_end, mcl_ocean +depends = mcl_mapgen, mcl_mapgen_core, mcl_core, mcl_worlds, mcl_farming, mcl_flowers, mcl_end, mcl_ocean diff --git a/mods/MAPGEN/mcl_dungeons/init.lua b/mods/MAPGEN/mcl_dungeons/init.lua index 40af11d37..b52a72ee6 100644 --- a/mods/MAPGEN/mcl_dungeons/init.lua +++ b/mods/MAPGEN/mcl_dungeons/init.lua @@ -32,11 +32,11 @@ local math_max = math.max local math_ceil = math.ceil --custom mcl_vars -local get_node = mcl_vars.get_node +local get_node = mcl_mapgen.get_far_node -local min_y = math_max(mcl_vars.mg_overworld_min, mcl_vars.mg_bedrock_overworld_max) + 1 -local max_y = mcl_vars.mg_overworld_max - 1 +local min_y = math_max(mcl_mapgen.overworld.min, mcl_vars.mg_bedrock_overworld_max) + 1 +local max_y = mcl_mapgen.overworld.max - 1 -- Calculate the number of dungeon spawn attempts -- In Minecraft, there 8 dungeon spawn attempts Minecraft chunk (16*256*16 = 65536 blocks). -- Minetest chunks don't have this size, so scale the number accordingly. diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index b14e1c2c7..563b62050 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -97,8 +97,8 @@ for s=1, #specialstones do clust_scarcity = 15*15*15, clust_num_ores = 33, clust_size = 5, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -117,8 +117,8 @@ for s=1, #specialstones do clust_scarcity = 10*10*10, clust_num_ores = 58, clust_size = 7, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -142,8 +142,8 @@ minetest.register_ore({ clust_scarcity = 15*15*15, clust_num_ores = 33, clust_size = 4, - y_min = mcl_vars.mg_overworld_min, - y_max = mcl_vars.mg_overworld_max, + y_min = mcl_mapgen.overworld.min, + y_max = mcl_mapgen.overworld.max, noise_params = { offset = 0, scale = 1, @@ -164,7 +164,7 @@ minetest.register_ore({ clust_scarcity = 14*14*14, clust_num_ores = 33, clust_size = 5, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(111), noise_params = { offset = 0, @@ -191,7 +191,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 525*3, clust_num_ores = 5, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(50), }) minetest.register_ore({ @@ -201,7 +201,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 510*3, clust_num_ores = 8, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(50), }) minetest.register_ore({ @@ -211,7 +211,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 500*3, clust_num_ores = 12, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(50), }) @@ -289,7 +289,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 830, clust_num_ores = 5, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(39), }) minetest.register_ore({ @@ -315,7 +315,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 4775, clust_num_ores = 5, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(30), }) minetest.register_ore({ @@ -325,7 +325,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 6560, clust_num_ores = 7, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(30), }) @@ -353,7 +353,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 10000, clust_num_ores = 4, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(12), }) minetest.register_ore({ @@ -363,7 +363,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 5000, clust_num_ores = 2, clust_size = 2, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(12), }) minetest.register_ore({ @@ -373,7 +373,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 10000, clust_num_ores = 8, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(12), }) @@ -411,7 +411,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 500, clust_num_ores = 4, clust_size = 3, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(13), }) minetest.register_ore({ @@ -421,7 +421,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 800, clust_num_ores = 7, clust_size = 4, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(13), }) @@ -462,7 +462,7 @@ if minetest.settings:get_bool("mcl_generate_ores", true) then clust_scarcity = 14340, clust_num_ores = 1, clust_size = 1, - y_min = mcl_vars.mg_overworld_min, + y_min = mcl_mapgen.overworld.min, y_max = mcl_worlds.layer_to_y(29), }) -- Rare spawn @@ -678,7 +678,7 @@ local function register_mgv6_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:cactus", height = 1, height_max = 3, @@ -698,7 +698,7 @@ local function register_mgv6_decorations() persist = 0.7 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:reeds", height = 1, height_max = 3, @@ -728,7 +728,7 @@ local function register_mgv6_decorations() persist = 0.0, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, }) -- Large ferns @@ -757,7 +757,7 @@ local function register_mgv6_decorations() persist = 0.66, }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, }) -- Large flowers @@ -1006,7 +1006,7 @@ local function register_mgv6_decorations() persist = 0.666 }, flags = "force_placement", - y_min = mcl_vars.mg_lava_overworld_max + 5, + y_min = mcl_mapgen.overworld.lava_max + 5, y_max = -20, }) @@ -1038,7 +1038,7 @@ local function register_mgv6_decorations() persist = 0.6 }, y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = mushrooms[m], spawn_by = { "mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree", }, num_spawn_by = 1, @@ -1059,7 +1059,7 @@ local function register_mgv6_decorations() persist = 0.6 }, y_min = 4, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:deadbush", }) @@ -1068,7 +1068,7 @@ local function register_mgv6_decorations() offset = 0 end if y_max == nil then - y_max = mcl_vars.mg_overworld_max + y_max = mcl_mapgen.overworld.max end minetest.register_decoration({ deco_type = "simple", @@ -1111,7 +1111,7 @@ local function register_mgv6_decorations() sidelen = 16, fill_ratio = 11.0, -- complete coverage y_min = 1, - y_max = mcl_vars.mg_overworld_max, + y_max = mcl_mapgen.overworld.max, decoration = "mcl_core:snow", }) @@ -1719,7 +1719,7 @@ local generate_underground_mushrooms = function(minp, maxp, seed) local pr_shroom = PseudoRandom(seed-24359) -- Generate rare underground mushrooms -- TODO: Make them appear in groups, use Perlin noise - local min, max = mcl_vars.mg_lava_overworld_max + 4, 0 + local min, max = mcl_mapgen.overworld.lava_max + 4, 0 if minp.y > max or maxp.y < min then return end @@ -1752,7 +1752,7 @@ end local generate_nether_decorations = function(minp, maxp, seed) local pr_nether = PseudoRandom(seed+667) - if minp.y > mcl_vars.mg_nether_max or maxp.y < mcl_vars.mg_nether_min then + if minp.y > mcl_mapgen.nether.max or maxp.y < mcl_mapgen.nether.min then return end @@ -1899,23 +1899,23 @@ local function basic(c) local pr = PseudoRandom(blockseed) -- The Void below the Nether: - lvm_used = set_layers(data, area, c_void , nil, mcl_mapgen.EDGE_MIN , mcl_vars.mg_nether_min -1, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_void , nil, mcl_mapgen.EDGE_MIN , mcl_mapgen.nether.min -1, minp, maxp, lvm_used, pr) - -- [[ THE NETHER: mcl_vars.mg_nether_min mcl_vars.mg_nether_max ]] + -- [[ THE NETHER: mcl_mapgen.nether.min mcl_mapgen.nether.max ]] -- The Air on the Nether roof, https://git.minetest.land/MineClone2/MineClone2/issues/1186 - lvm_used = set_layers(data, area, c_air , nil, mcl_vars.mg_nether_max +1, mcl_vars.mg_nether_max + 128 , minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_air , nil, mcl_mapgen.nether.max +1, mcl_mapgen.nether.max + 128 , minp, maxp, lvm_used, pr) -- The Void above the Nether below the End: - lvm_used = set_layers(data, area, c_void , nil, mcl_vars.mg_nether_max + 128 +1, mcl_vars.mg_end_min -1, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_void , nil, mcl_mapgen.nether.max + 128 +1, mcl_mapgen.end.min -1, minp, maxp, lvm_used, pr) - -- [[ THE END: mcl_vars.mg_end_min mcl_vars.mg_end_max ]] + -- [[ THE END: mcl_mapgen.end.min mcl_mapgen.end.max ]] -- The Void above the End below the Realm barrier: - lvm_used = set_layers(data, area, c_void , nil, mcl_vars.mg_end_max +1, mcl_vars.mg_realm_barrier_overworld_end_min-1, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_void , nil, mcl_mapgen.end.max +1, mcl_vars.mg_realm_barrier_overworld_end_min-1, minp, maxp, lvm_used, pr) -- Realm barrier between the Overworld void and the End lvm_used = set_layers(data, area, c_realm_barrier, nil, mcl_vars.mg_realm_barrier_overworld_end_min , mcl_vars.mg_realm_barrier_overworld_end_max , minp, maxp, lvm_used, pr) -- The Void above Realm barrier below the Overworld: - lvm_used = set_layers(data, area, c_void , nil, mcl_vars.mg_realm_barrier_overworld_end_max+1, mcl_vars.mg_overworld_min -1, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_void , nil, mcl_vars.mg_realm_barrier_overworld_end_max+1, mcl_mapgen.overworld.min -1, minp, maxp, lvm_used, pr) if mg_name ~= "singlenode" then @@ -1931,8 +1931,8 @@ local function basic(c) -- Big lava seas by replacing air below a certain height if mcl_vars.mg_lava then - lvm_used = set_layers(data, area, c_lava, c_air, mcl_vars.mg_overworld_min, mcl_vars.mg_lava_overworld_max, minp, maxp, lvm_used, pr) - lvm_used = set_layers(data, area, c_nether_lava, c_air, mcl_vars.mg_nether_min, mcl_vars.mg_lava_nether_max, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_lava, c_air, mcl_mapgen.overworld.min, mcl_mapgen.overworld.lava_max, minp, maxp, lvm_used, pr) + lvm_used = set_layers(data, area, c_nether_lava, c_air, mcl_mapgen.nether.min, mcl_vars.mg_lava_nether_max, minp, maxp, lvm_used, pr) end -- Clay, vines, cocoas @@ -1948,7 +1948,7 @@ local function basic(c) -- Snow and sand fixes. This code implements snow consistency -- and fixes floating sand and cut plants. -- A snowy grass block must be below a top snow or snow block at all times. - if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then + if minp.y <= mcl_mapgen.overworld.max and maxp.y >= mcl_mapgen.overworld.min then -- v6 mapgen: if mg_name == "v6" then @@ -2014,7 +2014,7 @@ local function basic(c) -- Nether block fixes: -- * Replace water with Nether lava. -- * Replace stone, sand dirt in v6 so the Nether works in v6. - elseif emin.y <= mcl_vars.mg_nether_max and emax.y >= mcl_vars.mg_nether_min then + elseif emin.y <= mcl_mapgen.nether.max and emax.y >= mcl_mapgen.nether.min then if mg_name == "v6" then local nodes = minetest.find_nodes_in_area(emin, emax, {"mcl_core:water_source", "mcl_core:stone", "mcl_core:sand", "mcl_core:dirt"}) for n=1, #nodes do @@ -2041,7 +2041,7 @@ local function basic(c) -- * Replace water with end stone or air (depending on height). -- * Remove stone, sand, dirt in v6 so our End map generator works in v6. -- * Generate spawn platform (End portal destination) - elseif minp.y <= mcl_vars.mg_end_max and maxp.y >= mcl_vars.mg_end_min then + elseif minp.y <= mcl_mapgen.end.max and maxp.y >= mcl_mapgen.end.min then local nodes if mg_name == "v6" then nodes = minetest.find_nodes_in_area(emin, emax, {"mcl_core:water_source", "mcl_core:stone", "mcl_core:sand", "mcl_core:dirt"}) @@ -2083,11 +2083,11 @@ local function basic(c) -- Final hackery: Set sun light level in the End. -- -26912 is at a mapchunk border. local shadow = true - if minp.y >= -26912 and maxp.y <= mcl_vars.mg_end_max then + if minp.y >= -26912 and maxp.y <= mcl_mapgen.end.max then vm:set_lighting({day=15, night=15}) lvm_used = true end - if minp.y >= mcl_vars.mg_end_min and maxp.y <= -26911 then + if minp.y >= mcl_mapgen.end.min and maxp.y <= -26911 then shadow = false lvm_used = true end diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index e3f6b4829..8304061af 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -110,14 +110,14 @@ mcl_structures.generate_igloo = function(pos, rotation, pr) if r == 1 then -- Select basement depth local dim = mcl_worlds.pos_to_dimension(pos) - --local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + --local buffer = pos.y - (mcl_mapgen.overworld.lava_max + 10) local buffer if dim == "nether" then buffer = pos.y - (mcl_vars.mg_lava_nether_max + 10) elseif dim == "end" then buffer = pos.y - (mcl_vars.mg_end_min + 1) elseif dim == "overworld" then - buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + buffer = pos.y - (mcl_mapgen.overworld.lava_max + 10) else return success end @@ -277,7 +277,7 @@ local function hut_placement_callback(p1, p2, size, orientation, pr) if not p1 or not p2 then return end local legs = minetest.find_nodes_in_area(p1, p2, "mcl_core:tree") for i = 1, #legs do - while minetest.get_item_group(mcl_vars.get_node({x=legs[i].x, y=legs[i].y-1, z=legs[i].z}, true, 333333).name, "water") ~= 0 do + while minetest.get_item_group(mcl_mapgen.get_far_node({x=legs[i].x, y=legs[i].y-1, z=legs[i].z}, true, 333333).name, "water") ~= 0 do legs[i].y = legs[i].y - 1 minetest.swap_node(legs[i], {name = "mcl_core:tree", param2 = 2}) end diff --git a/mods/MAPGEN/mcl_villages/buildings.lua b/mods/MAPGEN/mcl_villages/buildings.lua index 9d8e7580f..b9c4f8e85 100644 --- a/mods/MAPGEN/mcl_villages/buildings.lua +++ b/mods/MAPGEN/mcl_villages/buildings.lua @@ -88,7 +88,7 @@ function settlements.create_site_plan(maxp, minp, pr) -- find center_surface of chunk local center_surface , surface_material = settlements.find_surface(center, true) local chunks = {} - chunks[mcl_vars.get_chunk_number(center)] = true + chunks[mcl_mapgen.get_chunk_number(center)] = true -- go build settlement around center if not center_surface then return false end @@ -124,7 +124,7 @@ function settlements.create_site_plan(maxp, minp, pr) ptx = settlements.round(ptx, 0) ptz = settlements.round(ptz, 0) local pos1 = { x=ptx, y=center_surface.y+50, z=ptz} - local chunk_number = mcl_vars.get_chunk_number(pos1) + local chunk_number = mcl_mapgen.get_chunk_number(pos1) local pos_surface, surface_material if chunks[chunk_number] then pos_surface, surface_material = settlements.find_surface(pos1) diff --git a/mods/MAPGEN/mcl_villages/utils.lua b/mods/MAPGEN/mcl_villages/utils.lua index 993de11c4..87473cc80 100644 --- a/mods/MAPGEN/mcl_villages/utils.lua +++ b/mods/MAPGEN/mcl_villages/utils.lua @@ -1,4 +1,4 @@ -local get_node = mcl_vars.get_node +local get_node = mcl_mapgen.get_far_node ------------------------------------------------------------------------------- -- function to copy tables diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index f5a8b4908..ad8c6d99f 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -94,7 +94,7 @@ end -- Max. and min. heights between rail corridors are generated local height_min if mcl_vars.mg_lava then - height_min = mcl_vars.mg_lava_overworld_max + 2 + height_min = mcl_mapgen.overworld.lava_max + 2 else height_min = mcl_vars.mg_bedrock_overworld_max + 2 end