diff --git a/mods/MAPGEN/mcl_geodes/init.lua b/mods/MAPGEN/mcl_geodes/init.lua index 413a8fbba..d2debf7cd 100644 --- a/mods/MAPGEN/mcl_geodes/init.lua +++ b/mods/MAPGEN/mcl_geodes/init.lua @@ -8,7 +8,7 @@ local adjacents = { } local function makegeode(pos,pr) - local size = pr:next(4,12) + local size = pr:next(2,8) local p1 = vector.offset(pos,-size,-size,-size) local p2 = vector.offset(pos,size,size,size) local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone"}) diff --git a/mods/MAPGEN/mcl_structures/API.md b/mods/MAPGEN/mcl_structures/API.md new file mode 100644 index 000000000..52d40b642 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/API.md @@ -0,0 +1,27 @@ +# mcl_structures +Structure placement API for MCL2. + +## mcl_structures.register_structure(name,structure definition) +### structure definition +{ + fill_ratio = OR noise = {}, + biomes = {}, + y_min =, + y_max =, + place_on = {}, + spawn_by = {}, + num_spawn_by = + flags = (default: "place_center_x, place_center_z, force_placement") + (same as decoration def) + y_offset =, --can be a number or a function returning a number + filenames = {} OR place_func = function(pos,filename) + -- filenames can be a list of any schematics accepted by mcl_structures.place_schematic + after_place = function(pos) +} +## mcl_structures.registered_structures +Table of the registered structure defintions indexed by name. + +## mcl_structures.place_structure(pos, def, pr) +Places a structure using the mapgen placement function + +## mcl_structures.place_schematic(pos, schematic, rotation, replacements, force_placement, flags, after_placement_callback, pr, callback_param) diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua index 5e0858fb1..be86df530 100644 --- a/mods/MAPGEN/mcl_structures/api.lua +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -72,6 +72,7 @@ function mcl_structures.register_structure(name,def,nospawn) --nospawn means it end) end minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups}) + def.structblock = structblock mcl_structures.registered_structures[name] = def end diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 665fbf4c0..a82dffbff 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -630,9 +630,8 @@ minetest.register_on_mods_loaded(function() else for n,d in pairs(mcl_structures.registered_structures) do if n == param then - mcl_structures.place_structure(pos,d,PseudoRandom(os.clock())) - minetest.chat_send_player(name, message) - return + mcl_structures.place_structure(pos,d,pr) + return true,message end end message = S("Error: Unknown structure type. Please use “/spawnstruct ”.") diff --git a/mods/MAPGEN/mcl_structures/mod.conf b/mods/MAPGEN/mcl_structures/mod.conf index 3150c7cec..c19113ad4 100644 --- a/mods/MAPGEN/mcl_structures/mod.conf +++ b/mods/MAPGEN/mcl_structures/mod.conf @@ -1,4 +1,4 @@ name = mcl_structures -author = Wuzzy -description = Structures for MCL2 +author = Wuzzy, cora +description = Structure placement for MCL2 depends = mcl_loot