From 66d117285254ee387822a73c4343177aea179e22 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 3 May 2021 05:24:53 +0400 Subject: [PATCH] [mapgen] Add ocean monument --- mods/CORE/mcl_mapgen/init.lua | 6 +++ mods/MAPGEN/mcl_ocean_monument/init.lua | 36 ++++++++++++++++++ mods/MAPGEN/mcl_ocean_monument/mod.conf | 4 ++ .../schematics/ocean_monument.mts | Bin 0 -> 8342 bytes mods/MAPGEN/mcl_villages/init.lua | 1 + 5 files changed, 47 insertions(+) create mode 100644 mods/MAPGEN/mcl_ocean_monument/init.lua create mode 100644 mods/MAPGEN/mcl_ocean_monument/mod.conf create mode 100644 mods/MAPGEN/mcl_ocean_monument/schematics/ocean_monument.mts diff --git a/mods/CORE/mcl_mapgen/init.lua b/mods/CORE/mcl_mapgen/init.lua index 9c6fb8a11..a5982ae4e 100644 --- a/mods/CORE/mcl_mapgen/init.lua +++ b/mods/CORE/mcl_mapgen/init.lua @@ -1,5 +1,9 @@ mcl_mapgen = {} +local priority = { + OCEAN_MONUMENT = 1000000 +} + local math_floor = math.floor local math_max = math.max local minetest_get_node = minetest.get_node @@ -398,3 +402,5 @@ mcl_mapgen.dungeons = normal mcl_mapgen.overworld = overworld mcl_mapgen.end_ = end_ mcl_mapgen.nether = nether + +mcl_mapgen.priorities = priority diff --git a/mods/MAPGEN/mcl_ocean_monument/init.lua b/mods/MAPGEN/mcl_ocean_monument/init.lua new file mode 100644 index 000000000..135e315bd --- /dev/null +++ b/mods/MAPGEN/mcl_ocean_monument/init.lua @@ -0,0 +1,36 @@ +local mcl_mapgen_get_far_node = mcl_mapgen.get_far_node +local minetest_log = minetest.log +local minetest_place_schematic = minetest.place_schematic +local minetest_pos_to_string = minetest.pos_to_string + +local path = minetest.get_modpath("mcl_ocean_monument") .. "/schematics/ocean_monument.mts" +local water, air = "mcl_core:water_source", "air" + +mcl_mapgen.register_chunk_generator(function(minp, maxp, seed) + local minp = minp + local y = minp.y + if y ~= -32 then return end + + local x, z = minp.x, minp.z + local pr = PseudoRandom(seed) + for i = 1, pr:next(10,100) do + if mcl_mapgen_get_far_node({x=pr:next(0,79)+x, y=1, z=pr:next(0,79)+z}).name ~= water then return end + end + for i = 1, pr:next(10,100) do + if mcl_mapgen_get_far_node({x=pr:next(0,79)+x, y=2, z=pr:next(0,79)+z}).name ~= air then return end + end + for i = 1, pr:next(10,100) do + if mcl_mapgen_get_far_node({x=pr:next(15,64)+x, y=pr:next(0,25)-25, z=pr:next(15,64)+z}).name ~= water then +-- minetest_log("warning", "[mcl_ocean_monument] Not water at " .. minetest_pos_to_string(minp)) + return + end + end + +-- minetest_place_schematic(minp, path, tostring(pr:next(0,3)*90), nil, true) + minetest_place_schematic(minp, path, 0, nil, true) + + minetest_log("action", "[mcl_ocean_monument] Placed at " .. minetest_pos_to_string(minp)) + + ---- TODO: SET UP SPECIAL NODES... + +end, mcl_mapgen.priorities.OCEAN_MONUMENT) diff --git a/mods/MAPGEN/mcl_ocean_monument/mod.conf b/mods/MAPGEN/mcl_ocean_monument/mod.conf new file mode 100644 index 000000000..62648e987 --- /dev/null +++ b/mods/MAPGEN/mcl_ocean_monument/mod.conf @@ -0,0 +1,4 @@ +name = mcl_ocean_monument +author = Sister of epCode +description = Adds Ocean Monument, https://git.minetest.land/MineClone2/MineClone2/issues/958#issuecomment-14102 +depends = mcl_mapgen, mcl_structures diff --git a/mods/MAPGEN/mcl_ocean_monument/schematics/ocean_monument.mts b/mods/MAPGEN/mcl_ocean_monument/schematics/ocean_monument.mts new file mode 100644 index 0000000000000000000000000000000000000000..f94b808b521a431c82d0ed5a708156daf748171b GIT binary patch literal 8342 zcmaKRcU)7+yLa3*t8TEMNU#73i--h+K$I3(lqwyhgg`)gZ&4vsH)}y!%!(ip0wTR? z=#YT10Ma28DFV_WHMAsz2)qaP_rCY@dGGz)`6HQgX6BjaJpDUke9O`pv>&7j5(lY9 z|L+ZS5cKP9uVBz=KNnxe02jC0{;Gk&URb}|!CwAuj?TeeEVJCc=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ntAGfx?}Zel9efOs{8%p`t4sp`LoYw#U=q{^0STpR;&&JEl#mypB?4?4&0NjhIjmD2sp@DEl4>WEph?a z7W~hLyw!u4eV_?fO5>$%+5ddvJMLei`$6|5Ra`e>8p{C_Ij|mA{;y~@Rafx;QVKi} xSO(}<{iy%9y}OLZ2XG=k2PQ(TrJHKb0A#)tExW&J82nTGe*g|}P=Npd literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index 2b7109451..6e30f7b1c 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -93,6 +93,7 @@ if mg_name ~= "singlenode" then local x = pr1:next(0, 40) + minp.x + 19 local z = pr1:next(0, 40) + minp.z + 19 local y = minetest_get_spawn_level(x, z) + if not y then return end if y < (min or y+1) then min = y end if y > (max or y-1) then max = y end end