forked from mtcontrib/plantlife_modpack
Remove biome_lib dep from dryplants (#63)
This commit is contained in:
parent
3fce92a9f5
commit
fbd4aaf034
@ -5,7 +5,7 @@ max_line_length = 185
|
|||||||
exclude_files = {".luacheckrc"}
|
exclude_files = {".luacheckrc"}
|
||||||
|
|
||||||
globals = {
|
globals = {
|
||||||
"biome_lib", "abstract_dryplants",
|
"biome_lib",
|
||||||
"bushes_classic",
|
"bushes_classic",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,3 @@
|
|||||||
-- by Mossmanikin
|
|
||||||
-- textures & ideas partly by Neuromancer
|
|
||||||
|
|
||||||
-- Contains code from: default, farming
|
|
||||||
-- Looked at code from: darkage, sickle, stairs
|
|
||||||
-- Dependencies: default, farming, biome_lib
|
|
||||||
-- Supports:
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
abstract_dryplants = {}
|
|
||||||
|
|
||||||
-- support for i18n
|
-- support for i18n
|
||||||
local S = minetest.get_translator("dryplants")
|
local S = minetest.get_translator("dryplants")
|
||||||
|
|
||||||
@ -191,5 +181,3 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
abstract_dryplants.loaded = true
|
|
||||||
|
@ -1,21 +1,12 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
-- Grasses - Juncus 0.0.5
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
-- by Mossmanikin
|
|
||||||
-- textures & ideas partly by Neuromancer
|
|
||||||
|
|
||||||
-- Contains code from: biome_lib
|
|
||||||
-- Looked at code from: default
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- support for i18n
|
-- support for i18n
|
||||||
local S = minetest.get_translator("dryplants")
|
local S = minetest.get_translator("dryplants")
|
||||||
|
|
||||||
abstract_dryplants.grow_juncus = function(pos)
|
local function grow_juncus(pos)
|
||||||
local juncus_type = math.random(2,3)
|
local juncus_type = math.random(2,3)
|
||||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
|
||||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
local nodename = minetest.get_node(right_here).name
|
||||||
|
if nodename == "air" or nodename == "default:junglegrass" then
|
||||||
if juncus_type == 2 then
|
if juncus_type == 2 then
|
||||||
minetest.swap_node(right_here, {name="dryplants:juncus_02"})
|
minetest.swap_node(right_here, {name="dryplants:juncus_02"})
|
||||||
else
|
else
|
||||||
@ -70,6 +61,7 @@ minetest.register_node("dryplants:juncus", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("dryplants:juncus_02", {
|
minetest.register_node("dryplants:juncus_02", {
|
||||||
description = S("Juncus"),
|
description = S("Juncus"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
@ -96,44 +88,69 @@ minetest.register_node("dryplants:juncus_02", {
|
|||||||
-- GENERATE SMALL JUNCUS
|
-- GENERATE SMALL JUNCUS
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- near water or swamp
|
-- near water or swamp
|
||||||
biome_lib.register_on_generate({
|
minetest.register_decoration({
|
||||||
surface = {
|
name = "dryplants:juncus_water",
|
||||||
|
decoration = {"air"},
|
||||||
|
fill_ratio = 0.16,
|
||||||
|
y_min = 1,
|
||||||
|
y_max = 40,
|
||||||
|
place_on = {
|
||||||
"default:dirt_with_grass",
|
"default:dirt_with_grass",
|
||||||
--"default:desert_sand",
|
|
||||||
--"default:sand",
|
|
||||||
"stoneage:grass_with_silex",
|
"stoneage:grass_with_silex",
|
||||||
"sumpf:peat",
|
"sumpf:peat",
|
||||||
"sumpf:sumpf"
|
"sumpf:sumpf"
|
||||||
},
|
},
|
||||||
max_count = 70,
|
deco_type = "simple",
|
||||||
rarity = 101 - 75,
|
flags = "all_floors",
|
||||||
min_elevation = 1, -- above sea level
|
spawn_by = {
|
||||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
"default:water_source",
|
||||||
near_nodes_size = 2,
|
"sumpf:dirtywater_source",
|
||||||
near_nodes_vertical = 1,
|
"sumpf:sumpf"
|
||||||
near_nodes_count = 1,
|
|
||||||
plantlife_limit = -0.9,
|
|
||||||
},
|
|
||||||
abstract_dryplants.grow_juncus
|
|
||||||
)
|
|
||||||
-- at dunes/beach
|
|
||||||
biome_lib.register_on_generate({
|
|
||||||
surface = {
|
|
||||||
--"default:dirt_with_grass",
|
|
||||||
--"default:desert_sand",
|
|
||||||
"default:sand",
|
|
||||||
--"stoneage:grass_with_silex",
|
|
||||||
--"sumpf:peat",
|
|
||||||
--"sumpf:sumpf"
|
|
||||||
},
|
},
|
||||||
max_count = 70,
|
check_offset = -1,
|
||||||
rarity = 101 - 75,
|
num_spawn_by = 1
|
||||||
min_elevation = 1, -- above sea level
|
})
|
||||||
near_nodes = {"default:dirt_with_grass"},
|
|
||||||
near_nodes_size = 2,
|
-- at dunes/beach
|
||||||
near_nodes_vertical = 1,
|
minetest.register_decoration({
|
||||||
near_nodes_count = 1,
|
name = "dryplants:juncus_beach",
|
||||||
plantlife_limit = -0.9,
|
decoration = {"air"},
|
||||||
},
|
fill_ratio = 0.08,
|
||||||
abstract_dryplants.grow_juncus
|
y_min = 1,
|
||||||
)
|
y_max = 40,
|
||||||
|
place_on = {
|
||||||
|
"default:sand",
|
||||||
|
},
|
||||||
|
deco_type = "simple",
|
||||||
|
flags = "all_floors",
|
||||||
|
spawn_by = {"default:dirt_with_grass"},
|
||||||
|
check_offset = -1,
|
||||||
|
num_spawn_by = 1
|
||||||
|
})
|
||||||
|
|
||||||
|
local did, did2
|
||||||
|
minetest.register_on_mods_loaded(function()
|
||||||
|
did = minetest.get_decoration_id("dryplants:juncus_water")
|
||||||
|
did2 = minetest.get_decoration_id("dryplants:juncus_beach")
|
||||||
|
minetest.set_gen_notify("decoration", {did, did2})
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
|
local g = minetest.get_mapgen_object("gennotify")
|
||||||
|
local locations = {}
|
||||||
|
|
||||||
|
local deco_locations_1 = g["decoration#" .. did] or {}
|
||||||
|
local deco_locations_2 = g["decoration#" .. did2] or {}
|
||||||
|
|
||||||
|
for _, pos in pairs(deco_locations_1) do
|
||||||
|
locations[#locations+1] = pos
|
||||||
|
end
|
||||||
|
for _, pos in pairs(deco_locations_2) do
|
||||||
|
locations[#locations+1] = pos
|
||||||
|
end
|
||||||
|
|
||||||
|
if #locations == 0 then return end
|
||||||
|
for _, pos in ipairs(locations) do
|
||||||
|
grow_juncus(pos)
|
||||||
|
end
|
||||||
|
end)
|
@ -1,25 +1,12 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
-- @reviewer: couldn't even find using biome_lib
|
||||||
-- Grasses - Meadow Variation 0.0.1
|
minetest.register_decoration({
|
||||||
-----------------------------------------------------------------------------------------------
|
decoration = {"dryplants:grass_short"},
|
||||||
-- by Mossmanikin
|
fill_ratio = 0.8,
|
||||||
|
y_min = 1,
|
||||||
-- Contains code from: biome_lib
|
y_max = 40,
|
||||||
-- Looked at code from: default
|
place_on = {
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
abstract_dryplants.grow_grass_variation = function(pos)
|
|
||||||
local right_here = {x=pos.x, y=pos.y, z=pos.z}
|
|
||||||
minetest.swap_node(right_here, {name="dryplants:grass_short"})
|
|
||||||
end
|
|
||||||
|
|
||||||
biome_lib.register_on_generate({
|
|
||||||
surface = {
|
|
||||||
"default:dirt_with_grass",
|
"default:dirt_with_grass",
|
||||||
},
|
},
|
||||||
max_count = 4800,
|
deco_type = "simple",
|
||||||
rarity = 25,
|
flags = "all_floors"
|
||||||
min_elevation = 1, -- above sea level
|
})
|
||||||
plantlife_limit = -0.9,
|
|
||||||
},
|
|
||||||
abstract_dryplants.grow_grass_variation
|
|
||||||
)
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name = dryplants
|
name = dryplants
|
||||||
depends = default, biome_lib
|
depends = default
|
||||||
optional_depends = farming
|
optional_depends = farming
|
||||||
|
@ -1,30 +1,20 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
minetest.register_decoration({
|
||||||
-- Grasses - More Tall Grass 0.0.2
|
decoration = {
|
||||||
-----------------------------------------------------------------------------------------------
|
"default:grass_1",
|
||||||
-- by Mossmanikin
|
|
||||||
|
|
||||||
-- Contains code from: biome_lib
|
|
||||||
-- Looked at code from: default
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
biome_lib.register_on_generate(
|
|
||||||
{
|
|
||||||
surface = {
|
|
||||||
"default:dirt_with_grass",
|
|
||||||
"stoneage:grass_with_silex",
|
|
||||||
"sumpf:peat",
|
|
||||||
"sumpf:sumpf"
|
|
||||||
},
|
|
||||||
max_count = 4800,
|
|
||||||
rarity = 101 - 75,
|
|
||||||
min_elevation = 1, -- above sea level
|
|
||||||
plantlife_limit = -0.9,
|
|
||||||
check_air = true,
|
|
||||||
},
|
|
||||||
{ "default:grass_1",
|
|
||||||
"default:grass_2",
|
"default:grass_2",
|
||||||
"default:grass_3",
|
"default:grass_3",
|
||||||
"default:grass_4",
|
"default:grass_4",
|
||||||
"default:grass_5"
|
"default:grass_5"
|
||||||
}
|
},
|
||||||
)
|
fill_ratio = 0.8,
|
||||||
|
y_min = 1,
|
||||||
|
y_max = 40,
|
||||||
|
place_on = {
|
||||||
|
"default:dirt_with_grass",
|
||||||
|
"stoneage:grass_with_silex",
|
||||||
|
"sumpf:peat",
|
||||||
|
"sumpf:sumpf"
|
||||||
|
},
|
||||||
|
deco_type = "simple",
|
||||||
|
flags = "all_floors"
|
||||||
|
})
|
||||||
|
@ -1,13 +1,3 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
-- Grasses - Reedmace 0.1.1
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
-- by Mossmanikin
|
|
||||||
-- textures & ideas partly by Neuromancer
|
|
||||||
|
|
||||||
-- Contains code from: biome_lib
|
|
||||||
-- Looked at code from: default, trees
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- NOTES (from wikipedia, some of this might get implemented)
|
-- NOTES (from wikipedia, some of this might get implemented)
|
||||||
-- rhizomes are edible
|
-- rhizomes are edible
|
||||||
-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus
|
-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus
|
||||||
@ -24,14 +14,16 @@ local S = minetest.get_translator("dryplants")
|
|||||||
-- REEDMACE SHAPES
|
-- REEDMACE SHAPES
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
abstract_dryplants.grow_reedmace = function(pos)
|
local function grow_reedmace(pos)
|
||||||
local size = math.random(1,3)
|
local size = math.random(1,3)
|
||||||
local spikes = math.random(1,3)
|
local spikes = math.random(1,3)
|
||||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||||
if minetest.get_node(pos_01).name == "air" -- bug fix
|
|
||||||
or minetest.get_node(pos_01).name == "dryplants:reedmace_sapling" then
|
local nodename = minetest.get_node(pos_01).name
|
||||||
|
if nodename == "air" -- bug fix
|
||||||
|
or nodename == "dryplants:reedmace_sapling" then
|
||||||
if minetest.get_node(pos_02).name ~= "air" then
|
if minetest.get_node(pos_02).name ~= "air" then
|
||||||
minetest.swap_node(pos_01, {name="dryplants:reedmace_top"})
|
minetest.swap_node(pos_01, {name="dryplants:reedmace_top"})
|
||||||
elseif minetest.get_node(pos_03).name ~= "air" then
|
elseif minetest.get_node(pos_03).name ~= "air" then
|
||||||
@ -50,14 +42,16 @@ abstract_dryplants.grow_reedmace = function(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
abstract_dryplants.grow_reedmace_water = function(pos)
|
local function grow_reedmace_water(pos)
|
||||||
local size = math.random(1,3)
|
local size = math.random(1,3)
|
||||||
local spikes = math.random(1,3)
|
local spikes = math.random(1,3)
|
||||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||||
local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z}
|
local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z}
|
||||||
|
|
||||||
minetest.add_entity(pos_01, "dryplants:reedmace_water_entity")
|
minetest.add_entity(pos_01, "dryplants:reedmace_water_entity")
|
||||||
|
|
||||||
if minetest.get_node(pos_02).name == "air" then -- bug fix
|
if minetest.get_node(pos_02).name == "air" then -- bug fix
|
||||||
if minetest.get_node(pos_03).name ~= "air" then
|
if minetest.get_node(pos_03).name ~= "air" then
|
||||||
minetest.swap_node(pos_02, {name="dryplants:reedmace_top"})
|
minetest.swap_node(pos_02, {name="dryplants:reedmace_top"})
|
||||||
@ -284,11 +278,11 @@ minetest.register_abm({
|
|||||||
or string.find(minetest.get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water")
|
or string.find(minetest.get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water")
|
||||||
or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then
|
or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then
|
||||||
if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||||
abstract_dryplants.grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z})
|
grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||||
end
|
end
|
||||||
minetest.swap_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"})
|
minetest.swap_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"})
|
||||||
else
|
else
|
||||||
abstract_dryplants.grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z})
|
grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@ -326,89 +320,121 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- SPAWN REEDMACE
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
--[[biome_lib.register_active_spawner({
|
|
||||||
spawn_delay = 1200,
|
|
||||||
spawn_plants = {"dryplants:reedmace_sapling"},
|
|
||||||
spawn_chance = 400,
|
|
||||||
spawn_surfaces = {
|
|
||||||
"default:dirt_with_grass",
|
|
||||||
"default:desert_sand",
|
|
||||||
"default:sand",
|
|
||||||
"dryplants:grass_short",
|
|
||||||
"stoneage:grass_with_silex"
|
|
||||||
},
|
|
||||||
seed_diff = 329,
|
|
||||||
near_nodes = {"default:water_source"},
|
|
||||||
near_nodes_size = 2,
|
|
||||||
near_nodes_vertical = 1,
|
|
||||||
near_nodes_count = 1,
|
|
||||||
})]]
|
|
||||||
-----------------------------------------------------------------------------------------------
|
|
||||||
-- GENERATE REEDMACE
|
-- GENERATE REEDMACE
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- near water or swamp
|
-- near water or swamp
|
||||||
biome_lib.register_on_generate({
|
minetest.register_decoration({
|
||||||
surface = {
|
name = "dryplants:reedmace_swamp",
|
||||||
|
decoration = {"air"},
|
||||||
|
fill_ratio = "0.1",
|
||||||
|
y_min = 1,
|
||||||
|
y_max = 40,
|
||||||
|
place_on = {
|
||||||
"default:dirt_with_grass",
|
"default:dirt_with_grass",
|
||||||
"default:desert_sand",
|
"default:desert_sand",
|
||||||
"stoneage:grass_with_silex",
|
"stoneage:grass_with_silex",
|
||||||
"sumpf:peat",
|
"sumpf:peat",
|
||||||
"sumpf:sumpf"
|
"sumpf:sumpf"
|
||||||
},
|
},
|
||||||
max_count = 35,
|
deco_type = "simple",
|
||||||
rarity = 101 - 40,
|
flags = "all_floors",
|
||||||
--rarity = 60,
|
spawn_by = {
|
||||||
min_elevation = 1, -- above sea level
|
"default:water_source",
|
||||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
"sumpf:dirtywater_source",
|
||||||
near_nodes_size = 2,
|
"sumpf:sumpf"
|
||||||
near_nodes_vertical = 1,
|
},
|
||||||
near_nodes_count = 1,
|
check_offset = -1,
|
||||||
plantlife_limit = -0.9,
|
num_spawn_by = 1
|
||||||
},
|
})
|
||||||
abstract_dryplants.grow_reedmace
|
|
||||||
)
|
|
||||||
-- in water
|
-- in water
|
||||||
biome_lib.register_on_generate({
|
minetest.register_decoration({
|
||||||
surface = {
|
name = "dryplants:reedmace_water",
|
||||||
|
decoration = {"air"},
|
||||||
|
fill_ratio = "0.01",
|
||||||
|
y_min = 0,
|
||||||
|
y_max = 0,
|
||||||
|
place_on = {
|
||||||
"default:dirt",
|
"default:dirt",
|
||||||
"default:dirt_with_grass",
|
"default:dirt_with_grass",
|
||||||
--"default:desert_sand",
|
|
||||||
--"stoneage:grass_with_silex",
|
|
||||||
"stoneage:sand_with_silex",
|
"stoneage:sand_with_silex",
|
||||||
"sumpf:peat",
|
"sumpf:peat",
|
||||||
"sumpf:sumpf"
|
"sumpf:sumpf"
|
||||||
},
|
},
|
||||||
max_count = 35,
|
deco_type = "simple",
|
||||||
rarity = 101 - 65,
|
flags = "all_floors",
|
||||||
--rarity = 35,
|
spawn_by = {
|
||||||
min_elevation = 0, -- a bit below sea level
|
"default:water_source",
|
||||||
max_elevation = 0, -- ""
|
"sumpf:dirtywater_source"
|
||||||
near_nodes = {"default:water_source","sumpf:dirtywater_source"},
|
},
|
||||||
near_nodes_size = 1,
|
check_offset = -1,
|
||||||
near_nodes_count = 1,
|
num_spawn_by = 1
|
||||||
plantlife_limit = -0.9,
|
})
|
||||||
},
|
|
||||||
abstract_dryplants.grow_reedmace_water
|
|
||||||
)
|
|
||||||
-- for oases & tropical beaches & tropical swamps
|
-- for oases & tropical beaches & tropical swamps
|
||||||
biome_lib.register_on_generate({
|
minetest.register_decoration({
|
||||||
surface = {
|
name = "dryplants:reedmace_beach",
|
||||||
|
decoration = {"air"},
|
||||||
|
fill_ratio = "0.1",
|
||||||
|
y_min = 1,
|
||||||
|
y_max = 40,
|
||||||
|
place_on = {
|
||||||
"default:sand",
|
"default:sand",
|
||||||
"sumpf:sumpf"
|
"sumpf:sumpf"
|
||||||
},
|
},
|
||||||
max_count = 35,
|
deco_type = "simple",
|
||||||
rarity = 101 - 90,
|
flags = "all_floors",
|
||||||
--rarity = 10,
|
spawn_by = {
|
||||||
neighbors = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
"default:water_source",
|
||||||
ncount = 1,
|
"sumpf:dirtywater_source",
|
||||||
min_elevation = 1, -- above sea level
|
"sumpf:sumpf",
|
||||||
near_nodes = {"default:desert_sand","sumpf:sumpf"},
|
"default:desert_sand"
|
||||||
near_nodes_size = 2,
|
},
|
||||||
near_nodes_vertical = 1,
|
check_offset = -1,
|
||||||
near_nodes_count = 1,
|
num_spawn_by = 1
|
||||||
plantlife_limit = -0.9,
|
})
|
||||||
},
|
|
||||||
abstract_dryplants.grow_reedmace
|
local did, did2, did3
|
||||||
)
|
minetest.register_on_mods_loaded(function()
|
||||||
|
did = minetest.get_decoration_id("dryplants:reedmace_swamp")
|
||||||
|
did2 = minetest.get_decoration_id("dryplants:reedmace_water")
|
||||||
|
did3 = minetest.get_decoration_id("dryplants:reedmace_beach")
|
||||||
|
minetest.set_gen_notify("decoration", {did, did2, did3})
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
|
local g = minetest.get_mapgen_object("gennotify")
|
||||||
|
local locations = {}
|
||||||
|
|
||||||
|
local deco_locations_1 = g["decoration#" .. did] or {}
|
||||||
|
local deco_locations_3 = g["decoration#" .. did3] or {}
|
||||||
|
|
||||||
|
for _, pos in pairs(deco_locations_1) do
|
||||||
|
locations[#locations+1] = pos
|
||||||
|
end
|
||||||
|
for _, pos in pairs(deco_locations_3) do
|
||||||
|
locations[#locations+1] = pos
|
||||||
|
end
|
||||||
|
|
||||||
|
if #locations == 0 then return end
|
||||||
|
for _, pos in ipairs(locations) do
|
||||||
|
print(minetest.pos_to_string(pos))
|
||||||
|
grow_reedmace(pos)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
|
local g = minetest.get_mapgen_object("gennotify")
|
||||||
|
local locations = {}
|
||||||
|
|
||||||
|
local deco_locations_2 = g["decoration#" .. did2] or {}
|
||||||
|
|
||||||
|
for _, pos in pairs(deco_locations_2) do
|
||||||
|
locations[#locations+1] = pos
|
||||||
|
end
|
||||||
|
|
||||||
|
if #locations == 0 then return end
|
||||||
|
for _, pos in ipairs(locations) do
|
||||||
|
grow_reedmace_water(pos)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user