From 689e746366e9527c092b271a97eeb5bd9b22056b Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Tue, 10 May 2016 23:51:01 +0200 Subject: [PATCH] [sea] Update for #445 --- .../{LICENSE AND README.txt => LICENSE.txt} | 60 -- mods/sea/README.md | 59 ++ mods/sea/clams/init.lua | 28 +- mods/sea/noairblocks/init.lua | 2 +- mods/sea/seacoral/init.lua | 59 +- mods/sea/seagravel/init.lua | 2 +- mods/sea/seaplants/init.lua | 51 +- mods/sea/seawrecks/init.lua | 602 +++++++++--------- mods/sea/whiteshell/init.lua | 16 +- 9 files changed, 441 insertions(+), 438 deletions(-) rename mods/sea/{LICENSE AND README.txt => LICENSE.txt} (92%) mode change 100755 => 100644 create mode 100644 mods/sea/README.md diff --git a/mods/sea/LICENSE AND README.txt b/mods/sea/LICENSE.txt old mode 100755 new mode 100644 similarity index 92% rename from mods/sea/LICENSE AND README.txt rename to mods/sea/LICENSE.txt index 92f9b7db..3b0ad447 --- a/mods/sea/LICENSE AND README.txt +++ b/mods/sea/LICENSE.txt @@ -1,63 +1,3 @@ -------------------------------------------------------------------------------------------------- -sea-modpack -------------------------------------------------------------------------------------------------- - -Version 0.4.0 - -- clams --> collect algae for seaglass and crushed white shells for blocks -- noairblocks --> removes the airblocks around seacorals, seaplants and sealamps -- seacobble --> cobble in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue -- seacoral --> give some health directly and can be used as dyes with the unified dyes mod - and optionally the color machine mod - Colors: aqua, cyan, lime, magenta, redviolet and skyblue -- seaglass --> seaglass that can be on or off in the colors, neutral, white, yellow, red, blue and black -- seagravel --> gravel in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue -- sealamps --> a torch that burns under water and a diving lantern -- seaplants --> provide some health when eating them, combine them to make a seasalad mix -- seastone --> stone in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue -- seastonebrick --> stonebrick in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue -- seawrecks --> This version two types, consisting of 'default' materials -- stairsshine --> Just like minetest_game's stairs supports stair- and slabmaking for the blocks, - this one supports blocks that have a lightsource_14 -- whiteshell --> provides some more crushed white shells for blocks - ------------------------------------------------ -Dependencies ? = optional ------------------------------------------------ - -- clams --> default -- noairblocks --> default -- seacobble --> default, dye, stairs, clams, whiteshell? , colormachine? -- seacoral --> default, noairblocks, unifieddyes, colormachine? -- seaglass --> default, dye, stairs, clams, stairsshine? , colormachine? -- seagravel --> default, dye, stairs, clams, whiteshell? , colormachine? -- sealamps --> default, bucket, noairblocks -- seaplants --> default, noairblocks -- seastone --> default, dye, stairs, clams, whiteshell? , colormachine? -- seastonebrick --> default, stairs, seastone, colormachine? -- seawrecks --> default -- stairsshine --> default -- whiteshell --> default, clams - - ----------------------------------- -Credits ----------------------------------- - -- Celeron55 for making minetest and this mod possible (the mapgen.lua code (and part of his mob mod code) and for the minetest_game stairs mod) -- Kahrl for the minetest_game stairs mod -- VanessaE for making unifieddyes (among of a lot of other good mods) -- Cornernote (for the dye_code in an older sea version). Thanks for all your work for minetest cornernote! -- Chinchow, for asking me what I was doing (nothing constructive till then) -- Sapier, because of his fish in his animals-mod I understood you could build something under water without an waterblock around it. -- Inocudom, for the support of this modpack (and telling me about Jeija's hydro-turbine). -- Jeija (because of the hydro-turbine (mesecons)). -- Neuromancer for the constructive feed-back concerning the performance. -- Sokomine for constructive feedback of the total modpack -- Mossmanikin for his support -- Jouster27 for the helpful feedback about version 0.3.0 -- Chlue simple abm profiling ( https://forum.minetest.net/viewtopic.php?pid=113112#p113112 ) - Licenses -------------- diff --git a/mods/sea/README.md b/mods/sea/README.md new file mode 100644 index 00000000..488e0c71 --- /dev/null +++ b/mods/sea/README.md @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------------------------- +sea-modpack +------------------------------------------------------------------------------------------------- + +Version 0.4.0 + +- clams --> collect algae for seaglass and crushed white shells for blocks +- noairblocks --> removes the airblocks around seacorals, seaplants and sealamps +- seacobble --> cobble in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue +- seacoral --> give some health directly and can be used as dyes with the unified dyes mod + and optionally the color machine mod + Colors: aqua, cyan, lime, magenta, redviolet and skyblue +- seaglass --> seaglass that can be on or off in the colors, neutral, white, yellow, red, blue and black +- seagravel --> gravel in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue +- sealamps --> a torch that burns under water and a diving lantern +- seaplants --> provide some health when eating them, combine them to make a seasalad mix +- seastone --> stone in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue +- seastonebrick --> stonebrick in the colors white/neutral, aqua, cyan, lime, magenta, redviolet and skyblue +- seawrecks --> This version two types, consisting of 'default' materials +- stairsshine --> Just like minetest_game's stairs supports stair- and slabmaking for the blocks, + this one supports blocks that have a lightsource_14 +- whiteshell --> provides some more crushed white shells for blocks + +----------------------------------------------- +Dependencies ? = optional +----------------------------------------------- + +- clams --> default +- noairblocks --> default +- seacobble --> default, dye, stairs, clams, whiteshell? , colormachine? +- seacoral --> default, noairblocks, unifieddyes, colormachine? +- seaglass --> default, dye, stairs, clams, stairsshine? , colormachine? +- seagravel --> default, dye, stairs, clams, whiteshell? , colormachine? +- sealamps --> default, bucket, noairblocks +- seaplants --> default, noairblocks +- seastone --> default, dye, stairs, clams, whiteshell? , colormachine? +- seastonebrick --> default, stairs, seastone, colormachine? +- seawrecks --> default +- stairsshine --> default +- whiteshell --> default, clams + + +---------------------------------- +Credits +---------------------------------- + +- Celeron55 for making minetest and this mod possible (the mapgen.lua code (and part of his mob mod code) and for the minetest_game stairs mod) +- Kahrl for the minetest_game stairs mod +- VanessaE for making unifieddyes (among of a lot of other good mods) +- Cornernote (for the dye_code in an older sea version). Thanks for all your work for minetest cornernote! +- Chinchow, for asking me what I was doing (nothing constructive till then) +- Sapier, because of his fish in his animals-mod I understood you could build something under water without an waterblock around it. +- Inocudom, for the support of this modpack (and telling me about Jeija's hydro-turbine). +- Jeija (because of the hydro-turbine (mesecons)). +- Neuromancer for the constructive feed-back concerning the performance. +- Sokomine for constructive feedback of the total modpack +- Mossmanikin for his support +- Jouster27 for the helpful feedback about version 0.3.0 +- Chlue simple abm profiling ( https://forum.minetest.net/viewtopic.php?pid=113112#p113112 ) diff --git a/mods/sea/clams/init.lua b/mods/sea/clams/init.lua index 157034de..cb513138 100755 --- a/mods/sea/clams/init.lua +++ b/mods/sea/clams/init.lua @@ -35,7 +35,7 @@ minetest.register_node("clams:dirtalgae", { } } }, - sounds = default.node_sound_dirt_defaults, + sounds = default.node_sound_dirt_defaults, }) minetest.register_node("clams:sandalgaeused", { @@ -80,9 +80,9 @@ minetest.register_entity("clams:whiteshell", { phase = 0, phasetimer = 0, - on_activate = function(self, staticdata) - minetest.log("whiteshell activated!") - end, + -- on_activate = function(self, staticdata) + -- minetest.log("whiteshell activated!") + -- end, on_step = function(self, dtime) self.phasetimer = self.phasetimer + dtime @@ -160,8 +160,8 @@ minetest.register_ore({ clust_scarcity = 9*9*9, clust_num_ores = 16, clust_size = 4, - y_max = -4, - y_min = -60, + y_max = -4, + y_min = -60, }) minetest.register_ore({ @@ -171,17 +171,17 @@ minetest.register_ore({ clust_scarcity = 9*9*9, clust_num_ores = 16, clust_size = 4, - y_max = -4, - y_min = -60, + y_max = -4, + y_min = -60, }) -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) if chunk_size >= y_max - y_min + 1 then return end @@ -191,7 +191,7 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} @@ -389,4 +389,4 @@ minetest.register_alias("shells_dye:yellowlightglass","clams:yellowlightglass") minetest.register_alias("shells_dye:redlightglass","clams:redlightglass") minetest.register_alias("shells_dye:bluelightglass","clams:bluelightglass") minetest.register_alias("shells_dye:whitelightglass","clams:whitelightglass") -minetest.register_alias("shells_dye:blacklightglass","clams:blacklightglass") +minetest.register_alias("shells_dye:blacklightglass","clams:blacklightglass") \ No newline at end of file diff --git a/mods/sea/noairblocks/init.lua b/mods/sea/noairblocks/init.lua index eaa9f518..d4e5c7dd 100755 --- a/mods/sea/noairblocks/init.lua +++ b/mods/sea/noairblocks/init.lua @@ -229,4 +229,4 @@ local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1} return end end, -}) +}) \ No newline at end of file diff --git a/mods/sea/seacoral/init.lua b/mods/sea/seacoral/init.lua index af7545ea..297ce2a2 100755 --- a/mods/sea/seacoral/init.lua +++ b/mods/sea/seacoral/init.lua @@ -1,5 +1,6 @@ -- NODES +-- Lightened nodes for MFF local sea_light_source = 5 minetest.register_node("seacoral:coralcyan", { @@ -279,8 +280,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -290,8 +291,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -301,8 +302,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -312,8 +313,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -323,8 +324,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -334,8 +335,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -345,8 +346,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -356,8 +357,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -367,8 +368,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -378,8 +379,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -389,8 +390,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) minetest.register_ore({ @@ -400,16 +401,16 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -4, - y_min = -8, + y_max = -4, + y_min = -8, }) -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) if chunk_size >= y_max - y_min + 1 then return end @@ -419,7 +420,7 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} diff --git a/mods/sea/seagravel/init.lua b/mods/sea/seagravel/init.lua index 719d7d90..5739914f 100755 --- a/mods/sea/seagravel/init.lua +++ b/mods/sea/seagravel/init.lua @@ -178,4 +178,4 @@ register_seagravel_craft("seagravel:seagravel_magenta", {'clams:crushedwhite', ' register_seagravel_craft("seagravel:seagravel_lime", {'clams:crushedwhite', 'default:gravel','dye:lime'}) register_seagravel_craft("seagravel:seagravel_aqua", {'clams:crushedwhite', 'default:gravel','dye:aqua'}) register_seagravel_craft("seagravel:seagravel_skyblue", {'clams:crushedwhite', 'default:gravel','dye:skyblue'}) -register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'}) +register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'}) \ No newline at end of file diff --git a/mods/sea/seaplants/init.lua b/mods/sea/seaplants/init.lua index 98bbf637..ec3139fb 100755 --- a/mods/sea/seaplants/init.lua +++ b/mods/sea/seaplants/init.lua @@ -1,5 +1,6 @@ -- NODES +-- Lightened nodes for MFF local sea_light_source = 5 minetest.register_node("seaplants:kelpgreen", { @@ -244,8 +245,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -255,8 +256,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -266,8 +267,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -277,8 +278,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -288,8 +289,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -299,8 +300,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -310,8 +311,8 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) minetest.register_ore({ @@ -321,16 +322,16 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 24, clust_size = 4, - y_max = -14, - y_min = -31000, + y_max = -14, + y_min = -31000, }) -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) if chunk_size >= y_max - y_min + 1 then return end @@ -340,7 +341,7 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} @@ -412,9 +413,9 @@ action = function(pos, node, active_object_count, active_object_count_wider) minetest.get_node(yyp).name == "noairblocks:water_sourcex") then if (minetest.get_node(yyyp).name == "default:water_source" or minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then - minetest.add_node(pos, {name = "seaplants:kelpgreenmiddle"}) + minetest.add_node(pos, {name = "seaplants:kelpgreenmiddle"}) pos.y = pos.y + 1 - minetest.add_node(pos, {name = "seaplants:kelpgreen"}) + minetest.add_node(pos, {name = "seaplants:kelpgreen"}) else return end @@ -468,9 +469,9 @@ action = function(pos, node, active_object_count, active_object_count_wider) minetest.get_node(yyp).name == "noairblocks:water_sourcex") then if (minetest.get_node(yyyp).name == "default:water_source" or minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then - minetest.add_node(pos, {name = "seaplants:kelpbrownmiddle"}) + minetest.add_node(pos, {name = "seaplants:kelpbrownmiddle"}) pos.y = pos.y + 1 - minetest.add_node(pos, {name = "seaplants:kelpbrown"}) + minetest.add_node(pos, {name = "seaplants:kelpbrown"}) else return end diff --git a/mods/sea/seawrecks/init.lua b/mods/sea/seawrecks/init.lua index cde17ec5..fd1bcb76 100755 --- a/mods/sea/seawrecks/init.lua +++ b/mods/sea/seawrecks/init.lua @@ -49,7 +49,9 @@ minetest.register_node("seawrecks:woodshipchest", { meta:set_string("formspec", "size[8,9]".. "list[current_name;main;0,0;8,4;]".. - "list[current_player;main;0,5;8,4;]") + "list[current_player;main;0,5;8,4;]" .. + "listring[current_name;main]" .. + "listring[current_player;main]") meta:set_string("infotext", "Woodship chest") local inv = meta:get_inventory() inv:set_size("main", 8*4) @@ -58,7 +60,9 @@ meta:from_table({ main = {[1] = price_group[1], [2] = price_group[2], [32] = ""} }, fields = { - formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]", + formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]" .. + "listring[context;main]" .. + "listring[current_player;main]", infotext = "Normal chest" } }) @@ -112,7 +116,9 @@ minetest.register_node("seawrecks:ubootchest", { meta:set_string("formspec", "size[8,9]".. "list[current_name;main;0,0;8,4;]".. - "list[current_player;main;0,5;8,4;]") + "list[current_player;main;0,5;8,4;]" .. + "listring[current_name;main]" .. + "listring[current_player;main]") meta:set_string("infotext", "U-boot chest") local inv = meta:get_inventory() inv:set_size("main", 8*4) @@ -122,7 +128,9 @@ meta:from_table({ --main = {[1] = "default:wood", [2] = "default:tree", [32] = ""} }, fields = { - formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]", + formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]" .. + "listring[context;main]" .. + "listring[current_player;main]", infotext = "Normal chest" } }) @@ -157,37 +165,37 @@ minetest.register_ore({ clust_scarcity = 30*30*30, clust_num_ores = 1, clust_size = 12, - y_max = -4, - y_min = -31000, + y_max = -4, + y_min = -31000, }) minetest.register_ore({ ore_type = "scatter", ore = "seawrecks:uboot", - wherein = "default:sand", + wherein = "default:dirt", clust_scarcity = 30*30*30, clust_num_ores = 1, clust_size = 12, - y_max = -8, - y_min = -31000, + y_max = -8, + y_min = -31000, }) -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) if chunk_size >= y_max - y_min + 1 then return end local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1) local pr = PseudoRandom(seed) local num_chunks = math.floor(chunks_per_volume * volume) - local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) * 10 + local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} @@ -220,136 +228,131 @@ interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local yp = {x = pos.x, y = pos.y + 3, z = pos.z} - if minetest.get_node(pos).name == "seawrecks:woodship" and + if minetest.get_node(pos).name == "seawrecks:woodship" and (minetest.get_node(yp).name == "default:water_source" or minetest.get_node(yp).name == "noairblocks:water_sourcex") then minetest.add_node(pos, {name = "default:sand"}) - local rot - if math.random(1, 2) == 1 then - rot = {"x", "z"} - else - rot = {"z", "x"} - end + pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] - 6 + pos.x = pos.x - 6 for a = 1, 11 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 10 + pos.z = pos.z + 1 + pos.x = pos.x - 10 for a = 1, 9 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] - 2 - pos[rot[1]] = pos[rot[1]] - 9 + pos.z = pos.z - 2 + pos.x = pos.x - 9 for a = 1, 9 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] - 8 - pos[rot[2]] = pos[rot[2]] - 1 + pos.x = pos.x - 8 + pos.z = pos.z - 1 for a = 1, 7 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] + 4 - pos[rot[1]] = pos[rot[1]] - 7 + pos.z = pos.z + 4 + pos.x = pos.x - 7 for a = 1, 7 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 2 + pos.z = pos.z - 1 + pos.x = pos.x - 2 minetest.add_node(pos, {name = "default:tree"}) - pos[rot[2]] = pos[rot[2]] + 2 - pos[rot[1]] = pos[rot[1]] - 8 + pos.z = pos.z + 2 + pos.x = pos.x - 8 minetest.add_node(pos, {name = "default:tree"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:tree"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:tree"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 2 + pos.z = pos.z - 1 + pos.x = pos.x + 2 minetest.add_node(pos, {name = "default:tree"}) pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 for a = 1, 7 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] + 4 - pos[rot[1]] = pos[rot[1]] - 7 + pos.z = pos.z + 4 + pos.x = pos.x - 7 for a = 1, 7 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] + 2 - pos[rot[1]] = pos[rot[1]] - 8 + pos.z = pos.z + 2 + pos.x = pos.x - 8 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 4 + pos.z = pos.z - 1 + pos.x = pos.x + 4 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 3 + pos.z = pos.z + 1 + pos.x = pos.x + 3 minetest.add_node(pos, {name = "default:wood"}) pos.y = pos.y + 1 @@ -359,14 +362,14 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z} minetest.add_node(pos, {name = "default:wood"}) pos.y = pos.y + 3 - pos[rot[2]] = pos[rot[2]] - 4 + pos.z = pos.z - 4 for a = 1, 7 do - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] - 3 + pos.z = pos.z - 3 for a = 1, 2 do pos.y = pos.y + 1 @@ -374,23 +377,24 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z} end pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] - 3 + pos.z = pos.z - 3 for a = 1, 5 do - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] - 2 + pos.z = pos.z - 2 minetest.add_node(pos, {name = "default:wood"}) pos.y = pos.y - 7 - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 2 + pos.z = pos.z + 1 + pos.x = pos.x - 2 minetest.add_node(pos, {name = "seawrecks:woodshipchest"}) + else - minetest.add_node(pos, {name = "default:sand"}) + return end end }) @@ -401,567 +405,563 @@ interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local yp = {x = pos.x, y = pos.y + 8, z = pos.z} - if minetest.get_node(pos).name == "seawrecks:uboot" and + if minetest.get_node(pos).name == "seawrecks:uboot" and (minetest.get_node(yp).name == "default:water_source" or minetest.get_node(yp).name == "noairblocks:water_sourcex") then - minetest.add_node(pos, {name = "default:sand"}) - local rot - if math.random(1, 2) == 1 then - rot = {"x", "z"} - else - rot = {"z", "x"} - end + minetest.add_node(pos, {name = "default:dirt"}) + pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] - 15 + pos.x = pos.x - 15 for a = 1, 31 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:cobble"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z + 1 + pos.x = pos.x + 1 for a = 1, 31 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:cobble"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] +1 + pos.z = pos.z + 1 + pos.x = pos.x +1 for a = 1, 27 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 3 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 3 + pos.x = pos.x + 1 for a = 1, 27 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 2 + pos.z = pos.z - 1 + pos.x = pos.x + 2 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 5 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z + 5 + pos.x = pos.x + 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 7 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 7 + pos.x = pos.x + 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 24 + pos.x = pos.x + 24 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 5 + pos.z = pos.z + 5 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 22 + pos.x = pos.x - 22 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 29 + pos.x = pos.x + 29 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 3 + pos.z = pos.z - 3 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 28 + pos.x = pos.x - 28 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 32 + pos.x = pos.x + 32 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 32 + pos.x = pos.x - 32 minetest.add_node(pos, {name = "default:stone"}) pos.y = pos.y + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 32 + pos.x = pos.x + 32 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] - 32 + pos.x = pos.x - 32 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 28 + pos.x = pos.x + 28 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] + 3 + pos.z = pos.z + 3 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] - 28 + pos.x = pos.x - 28 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 2 + pos.z = pos.z + 1 + pos.x = pos.x + 2 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 22 + pos.x = pos.x + 22 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 2 + pos.z = pos.z + 1 + pos.x = pos.x - 2 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 9 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] - 6 - pos[rot[1]] = pos[rot[1]] - 3 + pos.z = pos.z - 6 + pos.x = pos.x - 3 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 22 + pos.x = pos.x + 22 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 2 + pos.z = pos.z - 1 + pos.x = pos.x - 2 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:obsidian_glass"}) for a = 1, 9 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] + 7 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 7 + pos.x = pos.x - 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 7 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 7 + pos.x = pos.x + 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 24 + pos.x = pos.x + 24 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 5 + pos.z = pos.z + 5 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 22 + pos.x = pos.x - 22 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 29 + pos.x = pos.x + 29 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 3 + pos.z = pos.z - 3 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 28 + pos.x = pos.x - 28 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 32 + pos.x = pos.x + 32 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 32 + pos.x = pos.x - 32 minetest.add_node(pos, {name = "default:stone"}) pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 28 + pos.x = pos.x + 28 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 28 + pos.x = pos.x - 28 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 2 + pos.z = pos.z - 1 + pos.x = pos.x + 2 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 22 + pos.x = pos.x + 22 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 3 + pos.z = pos.z + 3 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 22 + pos.x = pos.x - 22 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 2 + pos.z = pos.z + 1 + pos.x = pos.x + 2 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 5 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 5 + pos.x = pos.x + 1 for a = 1, 21 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end pos.y = pos.y + 1 - pos[rot[2]] = pos[rot[2]] + 2 - pos[rot[1]] = pos[rot[1]] - 4 + pos.z = pos.z + 2 + pos.x = pos.x - 4 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[1]] = pos[rot[1]] + 21 + pos.x = pos.x + 21 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z + 1 + pos.x = pos.x + 1 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[1]] = pos[rot[1]] - 21 + pos.x = pos.x - 21 for a = 1, 3 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 2 - pos[rot[1]] = pos[rot[1]] + 3 + pos.z = pos.z + 2 + pos.x = pos.x + 3 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 1 + pos.x = pos.x + 1 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[1]] = pos[rot[1]] + 6 + pos.x = pos.x + 6 for a = 1, 13 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] - 3 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z - 3 + pos.x = pos.x + 1 for a = 1, 13 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:stone"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 1 + pos.x = pos.x - 1 for a = 1, 13 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] + 1 - pos[rot[1]] = pos[rot[1]] + 1 + pos.z = pos.z + 1 + pos.x = pos.x + 1 for a = 1, 13 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:tree"}) end - pos[rot[2]] = pos[rot[2]] - 3 + pos.z = pos.z - 3 for a = 1, 6 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[2]] = pos[rot[2]] + 5 - pos[rot[1]] = pos[rot[1]] - 1 + pos.z = pos.z + 5 + pos.x = pos.x - 1 for a = 1, 6 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y + 1 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 5 - pos[rot[2]] = pos[rot[2]] - 1 + pos.x = pos.x - 5 + pos.z = pos.z - 1 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:wood"}) end for a = 1, 4 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] + 1 - pos[rot[2]] = pos[rot[2]] - 3 + pos.x = pos.x + 1 + pos.z = pos.z - 3 for a = 1, 4 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] - 1 - pos[rot[2]] = pos[rot[2]] - 1 + pos.x = pos.x - 1 + pos.z = pos.z - 1 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] + 1 + pos.z = pos.z + 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] + 5 - pos[rot[2]] = pos[rot[2]] + 1 + pos.x = pos.x + 5 + pos.z = pos.z + 1 for a = 1, 4 do - pos[rot[2]] = pos[rot[2]] - 1 + pos.z = pos.z - 1 minetest.add_node(pos, {name = "default:wood"}) end for a = 1, 4 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 - pos[rot[2]] = pos[rot[2]] + 3 + pos.x = pos.x - 1 + pos.z = pos.z + 3 for a = 1, 4 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y + 1 - pos[rot[1]] = pos[rot[1]] - 1 - pos[rot[2]] = pos[rot[2]] - 1 + pos.x = pos.x - 1 + pos.z = pos.z - 1 for a = 1, 2 do - pos[rot[1]] = pos[rot[1]] - 1 + pos.x = pos.x - 1 minetest.add_node(pos, {name = "default:wood"}) end - pos[rot[1]] = pos[rot[1]] - 1 - pos[rot[2]] = pos[rot[2]] - 1 + pos.x = pos.x - 1 + pos.z = pos.z - 1 for a = 1, 2 do - pos[rot[1]] = pos[rot[1]] + 1 + pos.x = pos.x + 1 minetest.add_node(pos, {name = "default:wood"}) end pos.y = pos.y - 7 - pos[rot[1]] = pos[rot[1]] +16 - pos[rot[2]] = pos[rot[2]] +3 + pos.x = pos.x +16 + pos.z = pos.z +3 minetest.set_node(pos, {name = "seawrecks:ubootchest"}) + else - minetest.add_node(pos, {name = "default:sand"}) + return end end -}) +}) \ No newline at end of file diff --git a/mods/sea/whiteshell/init.lua b/mods/sea/whiteshell/init.lua index 73c30cef..176c2d5d 100755 --- a/mods/sea/whiteshell/init.lua +++ b/mods/sea/whiteshell/init.lua @@ -32,17 +32,17 @@ minetest.register_ore({ clust_scarcity = 10*10*10, clust_num_ores = 18, clust_size = 6, - y_max = 31000, - y_min = -31000, + y_max = 31000, + y_min = -31000, }) -local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) if chunk_size >= y_max - y_min + 1 then return end @@ -52,7 +52,7 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} @@ -80,3 +80,5 @@ end minetest.register_alias("clams:whiteshell","whiteshell:whiteshell") + +minetest.log("action", "[Mod] Sea Loaded.")