forked from mtcontrib/plantlife_modpack
Compare commits
5 Commits
master
...
ferns_rm_b
Author | SHA1 | Date | |
---|---|---|---|
80cedce7c6 | |||
21816e5a43 | |||
3c390beb0f | |||
e0dca20186 | |||
25fbc53114 |
@ -273,11 +273,6 @@ local function grow_youngtree2(pos)
|
||||
grow_youngtree_node2(pos,height)
|
||||
end
|
||||
|
||||
-- NALC purposes
|
||||
abstract_bushes = {}
|
||||
abstract_bushes.grow_youngtree2 = grow_youngtree2
|
||||
--
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "bushes:youngtree",
|
||||
decoration = {
|
||||
@ -319,6 +314,4 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_youngtree2(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.log("action", "[bushes] loaded.")
|
||||
end)
|
@ -4,8 +4,6 @@ local S = minetest.get_translator("bushes_classic")
|
||||
plantlife_bushes = {}
|
||||
|
||||
-- TODO: add support for nodebreakers? those dig like mese picks
|
||||
local random = math.random
|
||||
|
||||
plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if not (digger and pos and oldnode) then
|
||||
return
|
||||
@ -65,7 +63,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
|
||||
-- with a chance of 1/3, return 2 bushes
|
||||
local amount
|
||||
if can_harvest and random(1,3) == 1 then
|
||||
if can_harvest and math.random(1,3) == 1 then
|
||||
amount = "2"
|
||||
else
|
||||
amount = "1"
|
||||
@ -77,7 +75,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
elseif groupcaps.choppy then
|
||||
|
||||
-- the amount of sticks may vary
|
||||
local amount = random(4, 20)
|
||||
local amount = math.random(4, 20)
|
||||
-- return some sticks
|
||||
harvested = "default:stick " .. amount
|
||||
|
||||
@ -138,7 +136,7 @@ minetest.register_abm({
|
||||
local dirt = minetest.get_node(dirtpos)
|
||||
local is_soil = minetest.get_item_group(dirt.name, "soil") or minetest.get_item_group(dirt.name, "potting_soil")
|
||||
|
||||
if is_soil and (dirt.name == "farming:soil_wet" or random(1,3) == 1) then
|
||||
if is_soil and (dirt.name == "farming:soil_wet" or math.random(1,3) == 1) then
|
||||
minetest.swap_node( pos, {name = "bushes:" .. bush_name .. "_bush"})
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,6 @@
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("cavestuff")
|
||||
|
||||
local random = math.random
|
||||
|
||||
--Rocks
|
||||
|
||||
local cbox = {
|
||||
@ -22,7 +20,7 @@ minetest.register_node("cavestuff:pebble_1",{
|
||||
collision_box = cbox,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:pebble_"..random(1,2))
|
||||
local stack = ItemStack("cavestuff:pebble_"..math.random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
@ -54,7 +52,7 @@ minetest.register_node("cavestuff:desert_pebble_1",{
|
||||
collision_box = cbox,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:desert_pebble_"..random(1,2))
|
||||
local stack = ItemStack("cavestuff:desert_pebble_"..math.random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:desert_pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
|
@ -153,4 +153,4 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
for _, pos in ipairs(locations) do
|
||||
grow_juncus(pos)
|
||||
end
|
||||
end)
|
||||
end)
|
@ -79,31 +79,3 @@ minetest.register_craft({
|
||||
output = "dye:green",
|
||||
recipe = {"group:horsetail"},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GLUE WOODEN TOOLS with RESIN & POLISH them with HORSETAIL (planned)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--[[minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:pick_wood",
|
||||
recipe = {"default:pick_wood","group:horsetail","farming:string","default:stick"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:shovel_wood",
|
||||
recipe = {"default:shovel_wood","group:horsetail","farming:string","default:stick"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:axe_wood",
|
||||
recipe = {"default:axe_wood","group:horsetail","farming:string","default:stick"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:sword_wood",
|
||||
recipe = {"default:sword_wood","group:horsetail","farming:string","default:stick"},
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "farming:hoe_wood",
|
||||
recipe = {"farming:hoe_wood","group:horsetail","farming:string","default:stick"},
|
||||
})]]
|
||||
|
248
ferns/fern.lua
248
ferns/fern.lua
@ -4,7 +4,6 @@
|
||||
-- by Mossmanikin
|
||||
-- Contains code from: biome_lib
|
||||
-- Looked at code from: default, flowers, painting, trees
|
||||
-- Dependencies: biome_lib
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- some inspiration from here
|
||||
@ -12,19 +11,10 @@
|
||||
-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_lady_fern == true)
|
||||
minetest.register_alias("ferns:fern_03", "default:fern_3")
|
||||
minetest.register_alias("ferns:fern_02", "default:fern_2")
|
||||
minetest.register_alias("ferns:fern_01", "default:fern_1")
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
|
||||
-- Maintain backward compatibilty
|
||||
-- minetest-0.5: Begin
|
||||
local default_ferns = minetest.registered_items["default:fern_1"] or false
|
||||
if default_ferns then
|
||||
minetest.register_alias("ferns:fern_03", "default:fern_3")
|
||||
minetest.register_alias("ferns:fern_02", "default:fern_2")
|
||||
minetest.register_alias("ferns:fern_01", "default:fern_1")
|
||||
end
|
||||
-- minetest-0.5: End
|
||||
minetest.register_alias("archaeplantae:fern", "ferns:fern_03")
|
||||
minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02")
|
||||
@ -33,183 +23,87 @@ minetest.register_alias("ferns:fern_04", "ferns:fern_02") -- for placing
|
||||
|
||||
local nodenames = {}
|
||||
|
||||
local function create_nodes()
|
||||
local images = { "ferns_fern.png", "ferns_fern_mid.png", "ferns_fern_big.png" }
|
||||
local vscales = { 1, math.sqrt(8), math.sqrt(11) }
|
||||
local descs = { S("Lady-fern (Athyrium)"), nil, nil }
|
||||
|
||||
for i = 1, 3 do
|
||||
local node_on_place = nil
|
||||
if i == 1 then
|
||||
node_on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random fern
|
||||
local stack = ItemStack("ferns:fern_0"..math.random(1,4))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("ferns:fern_01 "..itemstack:get_count()-(1-ret:get_count())) -- TODO FIXME?
|
||||
end
|
||||
end
|
||||
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
|
||||
minetest.register_node(nodenames[i], {
|
||||
description = descs[i] or (S("Lady-fern (Athyrium)").." " .. string.format("%02d", i)),
|
||||
inventory_image = "ferns_fern.png",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = vscales[i],
|
||||
paramtype = "light",
|
||||
tiles = { images[i] },
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
drop = "ferns:fern_01",
|
||||
on_place = node_on_place
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Init
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
if default_ferns then
|
||||
for i = 1, 3 do
|
||||
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
|
||||
end
|
||||
else
|
||||
create_nodes()
|
||||
for i = 1, 3 do
|
||||
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
if abstract_ferns.config.lady_ferns_near_tree == true then
|
||||
biome_lib.register_on_generate({ -- near trees (woodlands)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 30,
|
||||
rarity = 62,--63,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"group:tree"},
|
||||
near_nodes_size = 3,--4,
|
||||
near_nodes_vertical = 2,--3,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C (too hot?)
|
||||
temp_min = 0.75, -- -12 °C
|
||||
random_facedir = { 0, 179 },
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
nodenames
|
||||
)
|
||||
end
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = "group:tree",
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
|
||||
if abstract_ferns.config.lady_ferns_near_rock == true then
|
||||
biome_lib.register_on_generate({ -- near stone (mountains)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"group:falling_node",
|
||||
--"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 35,
|
||||
rarity = 40,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"group:stone"},
|
||||
near_nodes_size = 1,
|
||||
near_nodes_count = 16,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C (too hot?)
|
||||
temp_min = 0.75, -- -12 °C
|
||||
random_facedir = { 0, 179 },
|
||||
minetest.register_decoration({ -- near stone (mountains)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"group:falling_node",
|
||||
--"default:jungletree",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
nodenames
|
||||
)
|
||||
end
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = "group:stone",
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.3,
|
||||
})
|
||||
|
||||
if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop
|
||||
biome_lib.register_on_generate({ -- near ores (potential mining sites)
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"default:stone_with_tin", -- minetest >= 0.4.16
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 1200,--1600, -- maybe too much? :D
|
||||
rarity = 25,--15,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {
|
||||
"default:stone_with_iron",
|
||||
--"default:stone_with_copper",
|
||||
--"default:stone_with_mese",
|
||||
--"default:stone_with_gold",
|
||||
--"default:stone_with_diamond",
|
||||
"default:stone_with_tin", -- minetest >= 0.4.16
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver"
|
||||
--"moreores:mineral_mithril"
|
||||
},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 4,--5,--6,
|
||||
near_nodes_count = 2,--3,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C (too hot?)
|
||||
temp_min = 0.75, -- -12 °C
|
||||
random_facedir = { 0, 179 },
|
||||
minetest.register_decoration({ -- near stone (mountains)
|
||||
decoration = nodenames,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"default:stone_with_tin",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
nodenames
|
||||
)
|
||||
end
|
||||
|
||||
if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:mossycobble",
|
||||
"default:stone_with_coal",
|
||||
"default:stone_with_iron",
|
||||
"default:stone_with_tin", -- minetest >= 0.4.16
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 70,
|
||||
rarity = 25,--15,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {
|
||||
"default:stone"
|
||||
},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 2,--6,
|
||||
near_nodes_count = 3,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C (too hot?)
|
||||
temp_min = 0.75, -- -12 °C
|
||||
random_facedir = { 0, 179 },
|
||||
y_min = 1, -- above sea level
|
||||
param2 = 0,
|
||||
param2_max = 179,
|
||||
spawn_by = {
|
||||
"default:stone_with_iron",
|
||||
--"default:stone_with_copper",
|
||||
--"default:stone_with_mese",
|
||||
--"default:stone_with_gold",
|
||||
--"default:stone_with_diamond",
|
||||
"default:stone_with_tin",
|
||||
"moreores:mineral_tin",
|
||||
"moreores:mineral_silver"
|
||||
--"moreores:mineral_mithril"
|
||||
},
|
||||
nodenames
|
||||
)
|
||||
end
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.8,
|
||||
})
|
@ -7,8 +7,6 @@
|
||||
-- Supports: vines
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_giant_treefern == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
-- lot of code, lot to load
|
||||
@ -287,16 +285,13 @@ minetest.register_node("ferns:fern_trunk_big", {
|
||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
if digger == nil then return end
|
||||
local np = {x=pos.x,y=pos.y+1,z=pos.z}
|
||||
local nn = minetest.get_node(np)
|
||||
if nn.name == "ferns:fern_trunk_big" or
|
||||
nn.name == "ferns:fern_trunk_big_top"
|
||||
then
|
||||
minetest.node_dig(np, nn, digger)
|
||||
end
|
||||
end,
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk_big")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
@ -334,54 +329,50 @@ minetest.register_abm({
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- in jungles
|
||||
if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
"default:sand",
|
||||
"default:desert_sand"--,
|
||||
--"dryplants:grass_short"
|
||||
},
|
||||
max_count = 12,--27,
|
||||
avoid_nodes = {"group:tree"},
|
||||
avoid_radius = 3,--4,
|
||||
rarity = 85,
|
||||
seed_diff = 329,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:jungletree"},
|
||||
near_nodes_size = 6,
|
||||
near_nodes_vertical = 2,--4,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
"default:sand",
|
||||
"default:desert_sand"--,
|
||||
--"dryplants:grass_short"
|
||||
},
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
end
|
||||
max_count = 12,--27,
|
||||
avoid_nodes = {"group:tree"},
|
||||
avoid_radius = 3,--4,
|
||||
rarity = 85,
|
||||
seed_diff = 329,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:jungletree"},
|
||||
near_nodes_size = 6,
|
||||
near_nodes_vertical = 2,--4,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
|
||||
-- for oases & tropical beaches
|
||||
if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
},
|
||||
max_count = 10,--27,
|
||||
rarity = 90,
|
||||
seed_diff = 329,
|
||||
neighbors = {"default:desert_sand"},
|
||||
ncount = 1,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:water_source", "default:river_water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 1.0,
|
||||
temp_max = -1.0,
|
||||
temp_min = 1.0,
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
},
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
end
|
||||
max_count = 10,--27,
|
||||
rarity = 90,
|
||||
seed_diff = 329,
|
||||
neighbors = {"default:desert_sand"},
|
||||
ncount = 1,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:water_source", "default:river_water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 1.0,
|
||||
temp_max = -1.0,
|
||||
temp_min = 1.0,
|
||||
},
|
||||
abstract_ferns.grow_giant_tree_fern
|
||||
)
|
||||
|
@ -8,8 +8,6 @@
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_horsetails == true)
|
||||
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
-----------------------------------------------------------------------------------------------
|
||||
@ -71,101 +69,45 @@ end
|
||||
|
||||
create_nodes()
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Spawning
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if abstract_ferns.config.enable_horsetails_spawning == true then
|
||||
minetest.register_abm({
|
||||
nodenames = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:gravel"
|
||||
},
|
||||
interval = 1200,
|
||||
chance = 400,
|
||||
label = "[ferns] spawn horsetails",
|
||||
min_y = 1,
|
||||
max_y = 48,
|
||||
action = function(pos, node)
|
||||
local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local n_top = minetest.get_node_or_nil(p_top)
|
||||
if not n_top or n_top.name ~= "air" then return end
|
||||
|
||||
local NEAR_DST = 2
|
||||
if #minetest.find_nodes_in_area(
|
||||
{x=pos.x-NEAR_DST, y=pos.y-1, z=pos.z-NEAR_DST},
|
||||
{x=pos.x+NEAR_DST, y=pos.y+1, z=pos.z+NEAR_DST},
|
||||
{"default:water_source","default:river_water_source","default:gravel"}
|
||||
) < 1 then return
|
||||
end
|
||||
|
||||
local plant_to_spawn = node_names[math.random(1, #node_names)]
|
||||
|
||||
minetest.swap_node(p_top, {name = plant_to_spawn, param2 = 0})
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Generating
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_grass == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 35,
|
||||
rarity = 40,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {
|
||||
"group:water", -- likes water (of course)
|
||||
"default:gravel", -- near those on gravel
|
||||
"default:sand", -- some like sand
|
||||
"default:clay", -- some like clay
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:cobble",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
near_nodes_size = 3,
|
||||
near_nodes_vertical = 2,--3,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C
|
||||
temp_min = 0.53, -- 0 °C, dies back in winter
|
||||
--random_facedir = { 0, 179 },
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = node_names,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_coniferous_litter",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
node_names
|
||||
)
|
||||
end
|
||||
y_min = 1, -- above sea level
|
||||
spawn_by = {
|
||||
"group:water", -- likes water (of course)
|
||||
"default:gravel", -- near those on gravel
|
||||
"default:sand", -- some like sand
|
||||
"default:clay", -- some like clay
|
||||
"stoneage:grass_with_silex",
|
||||
"default:mossycobble",
|
||||
"default:cobble",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
|
||||
if abstract_ferns.config.enable_horsetails_on_stones == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex", -- roots go deep
|
||||
},
|
||||
max_count = 35,
|
||||
rarity = 20,
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5, -- 55 °C
|
||||
temp_min = 0.53, -- 0 °C, dies back in winter
|
||||
--random_facedir = { 0, 179 },
|
||||
minetest.register_decoration({ -- near trees (woodlands)
|
||||
decoration = node_names,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors",
|
||||
place_on = {
|
||||
"default:gravel", -- roots go deep
|
||||
"default:mossycobble",
|
||||
"stoneage:dirt_with_silex",
|
||||
"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex", -- roots go deep
|
||||
},
|
||||
node_names
|
||||
)
|
||||
end
|
||||
y_min = 1, -- above sea level
|
||||
fill_ratio = 0.1,
|
||||
})
|
@ -1,21 +1,7 @@
|
||||
abstract_ferns = {}
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/settings.lua")
|
||||
|
||||
if abstract_ferns.config.enable_lady_fern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/fern.lua")
|
||||
end
|
||||
|
||||
if abstract_ferns.config.enable_horsetails == true then
|
||||
dofile(minetest.get_modpath("ferns").."/horsetail.lua")
|
||||
end
|
||||
|
||||
if abstract_ferns.config.enable_treefern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/treefern.lua")
|
||||
end
|
||||
|
||||
if abstract_ferns.config.enable_giant_treefern == true then
|
||||
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath("ferns").."/fern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/horsetail.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/treefern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
|
||||
dofile(minetest.get_modpath("ferns").."/crafting.lua")
|
||||
|
@ -1,2 +1,2 @@
|
||||
name = ferns
|
||||
depends = default, biome_lib
|
||||
depends = default
|
||||
|
@ -1,43 +0,0 @@
|
||||
-- In case you don't wanna have errors:
|
||||
|
||||
-- Only change what's behind a "=" (or "--").
|
||||
-- Don't use caps (behind a "=").
|
||||
|
||||
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).
|
||||
-- Spelling is important.
|
||||
-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...)
|
||||
|
||||
-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment.
|
||||
-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then).
|
||||
-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error).
|
||||
|
||||
-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921
|
||||
|
||||
abstract_ferns.config = {}
|
||||
|
||||
-- Which plants should generate/spawn?
|
||||
abstract_ferns.config.enable_lady_fern = true
|
||||
abstract_ferns.config.enable_horsetails = true
|
||||
abstract_ferns.config.enable_treefern = true
|
||||
abstract_ferns.config.enable_giant_treefern = true
|
||||
|
||||
-- Where should they generate/spawn? (if they generate/spawn)
|
||||
--
|
||||
-- Lady-Fern
|
||||
abstract_ferns.config.lady_ferns_near_tree = true
|
||||
abstract_ferns.config.lady_ferns_near_rock = true
|
||||
abstract_ferns.config.lady_ferns_near_ores = true -- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop
|
||||
abstract_ferns.config.lady_ferns_in_groups = false -- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores
|
||||
--
|
||||
-- Horsetails
|
||||
abstract_ferns.config.enable_horsetails_spawning = false -- horsetails will grow in already explored areas, over time, near water or gravel
|
||||
abstract_ferns.config.enable_horsetails_on_grass = true -- on dirt with grass and swamp (sumpf mod)
|
||||
abstract_ferns.config.enable_horsetails_on_stones = true -- on gravel, mossy cobble and silex (stoneage mod)
|
||||
--
|
||||
-- Tree_Fern
|
||||
abstract_ferns.config.enable_treeferns_in_jungle = true
|
||||
abstract_ferns.config.enable_treeferns_in_oases = true -- for oases and tropical beaches
|
||||
--
|
||||
-- Giant_Tree_Fern
|
||||
abstract_ferns.config.enable_giant_treeferns_in_jungle = true
|
||||
abstract_ferns.config.enable_giant_treeferns_in_oases = true -- for oases and tropical beaches
|
@ -9,10 +9,6 @@
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("ferns")
|
||||
|
||||
assert(abstract_ferns.config.enable_treefern == true)
|
||||
|
||||
local random = math.random
|
||||
|
||||
function abstract_ferns.can_grow_tree_fern(pos)
|
||||
local node_name = minetest.get_node(pos).name
|
||||
if node_name ~= "air" and node_name ~= "ferns:sapling_tree_fern" and node_name ~= "default:junglegrass" then
|
||||
@ -41,12 +37,12 @@ abstract_ferns.grow_tree_fern = function(pos)
|
||||
return
|
||||
end
|
||||
|
||||
local size = random(1, 4) + random(1, 4)
|
||||
local size = math.random(1, 4) + math.random(1, 4)
|
||||
if (size > 5) then
|
||||
size = 10 - size
|
||||
end
|
||||
size = size + 1
|
||||
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[random(1, 2)]
|
||||
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)]
|
||||
|
||||
local i = 1
|
||||
local brk = false
|
||||
@ -163,9 +159,13 @@ minetest.register_node("ferns:fern_trunk", {
|
||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
@ -203,57 +203,53 @@ minetest.register_abm({
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- in jungles
|
||||
if abstract_ferns.config.enable_treeferns_in_jungle == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
"default:sand",
|
||||
"default:desert_sand",
|
||||
},
|
||||
max_count = 35,--27,
|
||||
avoid_nodes = {"default:tree"},
|
||||
avoid_radius = 4,
|
||||
rarity = 50,
|
||||
seed_diff = 329,
|
||||
min_elevation = -10,
|
||||
near_nodes = {"default:jungletree"},
|
||||
near_nodes_size = 6,
|
||||
near_nodes_vertical = 2,--4,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5,
|
||||
temp_min = 0.13,
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
|
||||
"default:sand",
|
||||
"default:desert_sand",
|
||||
},
|
||||
abstract_ferns.grow_tree_fern
|
||||
)
|
||||
end
|
||||
max_count = 35,--27,
|
||||
avoid_nodes = {"default:tree"},
|
||||
avoid_radius = 4,
|
||||
rarity = 50,
|
||||
seed_diff = 329,
|
||||
min_elevation = -10,
|
||||
near_nodes = {"default:jungletree"},
|
||||
near_nodes_size = 6,
|
||||
near_nodes_vertical = 2,--4,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 0.4,
|
||||
temp_max = -0.5,
|
||||
temp_min = 0.13,
|
||||
},
|
||||
abstract_ferns.grow_tree_fern
|
||||
)
|
||||
|
||||
-- for oases & tropical beaches
|
||||
if abstract_ferns.config.enable_treeferns_in_oases == true then
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
},
|
||||
max_count = 35,
|
||||
rarity = 50,
|
||||
seed_diff = 329,
|
||||
neighbors = {"default:desert_sand"},
|
||||
ncount = 1,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:water_source","default:river_water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 1.0,
|
||||
temp_max = -1.0,
|
||||
temp_min = 1.0,
|
||||
biome_lib.register_on_generate({
|
||||
surface = {
|
||||
"default:sand"--,
|
||||
--"default:desert_sand"
|
||||
},
|
||||
abstract_ferns.grow_tree_fern
|
||||
max_count = 35,
|
||||
rarity = 50,
|
||||
seed_diff = 329,
|
||||
neighbors = {"default:desert_sand"},
|
||||
ncount = 1,
|
||||
min_elevation = 1,
|
||||
near_nodes = {"default:water_source","default:river_water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
humidity_max = -1.0,
|
||||
humidity_min = 1.0,
|
||||
temp_max = -1.0,
|
||||
temp_min = 1.0,
|
||||
},
|
||||
abstract_ferns.grow_tree_fern
|
||||
)
|
||||
end
|
||||
|
@ -2,8 +2,6 @@
|
||||
local S = minetest.get_translator("nature_classic")
|
||||
-- Blossoms and such
|
||||
|
||||
local random = math.random
|
||||
|
||||
local function spawn_apple_under(pos)
|
||||
local below = {
|
||||
x = pos.x,
|
||||
@ -49,7 +47,7 @@ minetest.register_abm({
|
||||
chance = nature.leaves_blossom_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if random(nature.leaves_blossom_chance) == 1 then
|
||||
if math.random(nature.leaves_blossom_chance) == 1 then
|
||||
nature.enqueue_node(pos, node, nature.blossom_node)
|
||||
end
|
||||
end
|
||||
@ -64,7 +62,7 @@ minetest.register_abm({
|
||||
chance = nature.blossom_leaves_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if random(nature.blossom_leaves_chance) == 1 then
|
||||
if math.random(nature.blossom_leaves_chance) == 1 then
|
||||
nature.enqueue_node(pos, node, nature.blossom_leaves)
|
||||
end
|
||||
end
|
||||
@ -79,7 +77,7 @@ minetest.register_abm({
|
||||
chance = nature.apple_chance,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if random(4) == 1 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then
|
||||
if math.random(4) == 1 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then
|
||||
spawn_apple_under(pos)
|
||||
end
|
||||
end
|
||||
|
@ -40,5 +40,3 @@ nature.blossom_duration = nature.blossom_delay
|
||||
dofile(minetest.get_modpath(current_mod_name) .. "/config.lua")
|
||||
dofile(minetest.get_modpath(current_mod_name) .. "/global_function.lua")
|
||||
dofile(minetest.get_modpath(current_mod_name) .. "/blossom.lua")
|
||||
|
||||
minetest.log("action", "[Nature Classic] loaded!")
|
||||
|
@ -1,6 +1,5 @@
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("pl_seaweed")
|
||||
local random = math.random
|
||||
|
||||
local seaweed_rarity = minetest.settings:get("pl_seaweed.seaweed_rarity") or 0.06
|
||||
|
||||
@ -9,15 +8,7 @@ local function get_ndef(name)
|
||||
end
|
||||
|
||||
local algae_list = { {nil}, {2}, {3}, {4} }
|
||||
local seaweednames_list = {}
|
||||
|
||||
for i in ipairs(algae_list) do
|
||||
local num = ""
|
||||
if algae_list[i][1] ~= nil then
|
||||
num = "_"..algae_list[i][1]
|
||||
end
|
||||
table.insert(seaweednames_list, "flowers:seaweed"..num)
|
||||
end
|
||||
for i in ipairs(algae_list) do
|
||||
local num = ""
|
||||
local algae_groups = {snappy = 3,flammable=2,flower=1}
|
||||
@ -27,7 +18,7 @@ for i in ipairs(algae_list) do
|
||||
algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
|
||||
end
|
||||
|
||||
local seaweed_def = {
|
||||
minetest.register_node(":flowers:seaweed"..num, {
|
||||
description = S("Seaweed"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -54,6 +45,7 @@ for i in ipairs(algae_list) do
|
||||
buildable_to = true,
|
||||
|
||||
liquids_pointable = true,
|
||||
drop = "flowers:seaweed",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not itemstack or not placer or not pointed_thing then
|
||||
return
|
||||
@ -65,7 +57,6 @@ for i in ipairs(algae_list) do
|
||||
local place_pos = nil
|
||||
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
|
||||
local under_node = minetest.get_node(pt.under)
|
||||
local def = minetest.registered_nodes[under_node.name]
|
||||
local above_node = minetest.get_node(pt.above)
|
||||
local top_node = minetest.get_node(top_pos)
|
||||
if get_ndef(under_node.name)["buildable_to"] then
|
||||
@ -87,7 +78,8 @@ for i in ipairs(algae_list) do
|
||||
local nodename = "default:cobble" -- :D
|
||||
|
||||
if not keys["sneak"] then
|
||||
local seaweed = random(1,4)
|
||||
--local node = minetest.get_node(pt.under)
|
||||
local seaweed = math.random(1,4)
|
||||
if seaweed == 1 then
|
||||
nodename = "flowers:seaweed"
|
||||
elseif seaweed == 2 then
|
||||
@ -97,18 +89,10 @@ for i in ipairs(algae_list) do
|
||||
elseif seaweed == 4 then
|
||||
nodename = "flowers:seaweed_4"
|
||||
end
|
||||
minetest.swap_node(
|
||||
place_pos, {
|
||||
name = nodename..(def.waving == 3 and "_waving" or ""),
|
||||
param2 = random(0,3)
|
||||
})
|
||||
minetest.swap_node(place_pos, {name = nodename, param2 = math.random(0,3) })
|
||||
else
|
||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
minetest.swap_node(
|
||||
place_pos, {
|
||||
name = "flowers:seaweed"..(def.waving == 3 and "_waving" or ""),
|
||||
param2 = fdir
|
||||
})
|
||||
minetest.swap_node(place_pos, {name = "flowers:seaweed", param2 = fdir})
|
||||
end
|
||||
|
||||
if not minetest.is_creative_enabled(pname) then
|
||||
@ -116,20 +100,12 @@ for i in ipairs(algae_list) do
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
local seaweed_waving_def = table.copy(seaweed_def)
|
||||
seaweed_waving_def.waving = 3
|
||||
seaweed_waving_def.drop = "flowers:seaweed"
|
||||
seaweed_waving_def.groups.not_in_creative_inventory = 1
|
||||
|
||||
minetest.register_node(":flowers:seaweed"..num, seaweed_def)
|
||||
minetest.register_node(":flowers:seaweed"..num.."_waving", seaweed_waving_def)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "flowers:seaweed"..num,
|
||||
decoration = {"flowers:seaweed"..num.."_waving"},
|
||||
decoration = {"flowers:seaweed"..num},
|
||||
place_on = {"default:water_source"},
|
||||
deco_type = "simple",
|
||||
flags = "liquid_surface",
|
||||
@ -156,26 +132,6 @@ for i in ipairs(algae_list) do
|
||||
})
|
||||
end
|
||||
|
||||
-- LBM to replace old seaweed definition to add waving
|
||||
core.register_lbm({
|
||||
label = "Seaweed waving version",
|
||||
name = "pl_seaweed:seaweed_waving_version",
|
||||
nodenames = seaweednames_list,
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
local node_under = core.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local def_node_under = core.registered_nodes[node_under.name]
|
||||
local is_node_under_waving = def_node_under.waving and def_node_under.waving == 3
|
||||
|
||||
local def_node = core.registered_nodes[node.name]
|
||||
local is_node_waving = def_node.waving and def_node.waving == 3
|
||||
|
||||
if not is_node_waving and is_node_under_waving then
|
||||
core.swap_node(pos, {name = node.name.."_waving"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_alias("flowers:flower_seaweed", "flowers:seaweed")
|
||||
minetest.register_alias("along_shore:pondscum_1", "flowers:seaweed")
|
||||
minetest.register_alias("along_shore:seaweed_1", "flowers:seaweed")
|
||||
|
@ -1,6 +1,5 @@
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("pl_waterlilies")
|
||||
local random = math.random
|
||||
|
||||
local fill_ratio = minetest.settings:get("pl_waterlilies.waterlily_rarity") or 0.03
|
||||
|
||||
@ -39,7 +38,7 @@ for i in ipairs(lilies_list) do
|
||||
lily_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
|
||||
end
|
||||
|
||||
local waterlily_def = {
|
||||
minetest.register_node(":flowers:waterlily"..deg1, {
|
||||
description = S("Waterlily"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
@ -67,6 +66,7 @@ for i in ipairs(lilies_list) do
|
||||
node_placement_prediction = "",
|
||||
|
||||
liquids_pointable = true,
|
||||
drop = "flowers:waterlily",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not itemstack or not placer or not pointed_thing then
|
||||
return
|
||||
@ -78,7 +78,6 @@ for i in ipairs(lilies_list) do
|
||||
local place_pos = nil
|
||||
local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
|
||||
local under_node = minetest.get_node(pt.under)
|
||||
local def = minetest.registered_nodes[under_node.name]
|
||||
local above_node = minetest.get_node(pt.above)
|
||||
local top_node = minetest.get_node(top_pos)
|
||||
|
||||
@ -97,10 +96,10 @@ for i in ipairs(lilies_list) do
|
||||
local pname = placer:get_player_name()
|
||||
if place_pos and not minetest.is_protected(place_pos, pname) then
|
||||
|
||||
local nodename = "default:cobble" -- if this block appears, something went....wrong :-)
|
||||
local nodename = "default:cobble" -- if this block appears, something went....wrong :-)
|
||||
|
||||
if not keys["sneak"] then
|
||||
local waterlily = random(1,8)
|
||||
local waterlily = math.random(1,8)
|
||||
if waterlily == 1 then
|
||||
nodename = "flowers:waterlily"
|
||||
elseif waterlily == 2 then
|
||||
@ -118,18 +117,10 @@ for i in ipairs(lilies_list) do
|
||||
elseif waterlily == 8 then
|
||||
nodename = "flowers:waterlily_s4"
|
||||
end
|
||||
minetest.swap_node(
|
||||
place_pos, {
|
||||
name = nodename..(def.waving == 3 and "_waving" or ""),
|
||||
param2 = random(0,3)
|
||||
})
|
||||
minetest.swap_node(place_pos, {name = nodename, param2 = math.random(0,3) })
|
||||
else
|
||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
minetest.swap_node(
|
||||
place_pos, {
|
||||
name = "flowers:waterlily"..(def.waving == 3 and "_waving" or ""),
|
||||
param2 = fdir
|
||||
})
|
||||
minetest.swap_node(place_pos, {name = "flowers:waterlily", param2 = fdir})
|
||||
end
|
||||
|
||||
if not minetest.is_creative_enabled(pname) then
|
||||
@ -137,20 +128,12 @@ for i in ipairs(lilies_list) do
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
local waterlily_waving_def = table.copy(waterlily_def)
|
||||
waterlily_waving_def.waving = 3
|
||||
waterlily_waving_def.drop = "flowers:waterlily"
|
||||
waterlily_waving_def.groups.not_in_creative_inventory = 1
|
||||
|
||||
minetest.register_node(":flowers:waterlily"..deg1, waterlily_def)
|
||||
minetest.register_node(":flowers:waterlily"..deg1.."_waving", waterlily_waving_def)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "flowers:waterlily"..deg1,
|
||||
decoration = {"flowers:waterlily"..deg1.."_waving"},
|
||||
decoration = {"flowers:waterlily"..deg1},
|
||||
place_on = {"default:water_source"},
|
||||
deco_type = "simple",
|
||||
flags = "liquid_surface",
|
||||
@ -164,7 +147,7 @@ for i in ipairs(lilies_list) do
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "flowers:waterlily"..deg1 .."_relative",
|
||||
decoration = {"flowers:waterlily"..deg1.."_waving"},
|
||||
decoration = {"flowers:waterlily"..deg1},
|
||||
place_on = {"default:water_source"},
|
||||
deco_type = "simple",
|
||||
flags = "liquid_surface",
|
||||
@ -178,7 +161,7 @@ for i in ipairs(lilies_list) do
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "flowers:waterlily"..deg1 .."_relative",
|
||||
decoration = {"flowers:waterlily"..deg1.."_waving"},
|
||||
decoration = {"flowers:waterlily"..deg1},
|
||||
place_on = {"default:water_source"},
|
||||
deco_type = "simple",
|
||||
flags = "liquid_surface",
|
||||
@ -191,26 +174,6 @@ for i in ipairs(lilies_list) do
|
||||
})
|
||||
end
|
||||
|
||||
-- LBM to replace old waterlily definition to add waving
|
||||
core.register_lbm({
|
||||
label = "Waterlily waving version",
|
||||
name = "pl_waterlilies:waterlily_waving_version",
|
||||
nodenames = lilynames_list,
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node, s_dtime)
|
||||
local node_under = core.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local def_node_under = core.registered_nodes[node_under.name]
|
||||
local is_node_under_waving = def_node_under.waving and def_node_under.waving == 3
|
||||
|
||||
local def_node = core.registered_nodes[node.name]
|
||||
local is_node_waving = def_node.waving and def_node.waving == 3
|
||||
|
||||
if not is_node_waving and is_node_under_waving then
|
||||
core.swap_node(pos, {name = node.name.."_waving"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_alias( "flowers:flower_waterlily", "flowers:waterlily")
|
||||
minetest.register_alias( "flowers:flower_waterlily_225", "flowers:waterlily_225")
|
||||
minetest.register_alias( "flowers:flower_waterlily_45", "flowers:waterlily_45")
|
||||
|
@ -43,89 +43,6 @@ abstract_trunks.place_twig = function(pos)
|
||||
if check_node_buildable_to(east) then
|
||||
minetest.swap_node(east, {name="trunks:twig_8"})
|
||||
end
|
||||
elseif twig_size == 20 then
|
||||
n1 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1})
|
||||
n2 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1})
|
||||
r1 = n1 and minetest.registered_nodes[n1.name]
|
||||
r2 = n2 and minetest.registered_nodes[n2.name]
|
||||
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_5", param2=3})
|
||||
end
|
||||
if minetest.registered_nodes[node_n_w.name].buildable_to then
|
||||
minetest.swap_node(north_west, {name="trunks:twig_7", param2=3})
|
||||
end
|
||||
if minetest.registered_nodes[node_north.name].buildable_to then
|
||||
minetest.swap_node(north, {name="trunks:twig_8", param2=3})
|
||||
end
|
||||
end
|
||||
-- big twig 2
|
||||
elseif twig_size == 21 then
|
||||
n1 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1})
|
||||
n2 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1})
|
||||
r1 = n1 and minetest.registered_nodes[n1.name]
|
||||
r2 = n2 and minetest.registered_nodes[n2.name]
|
||||
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_9"})
|
||||
end
|
||||
if minetest.registered_nodes[node_north.name].buildable_to then
|
||||
minetest.swap_node(north, {name="trunks:twig_10"})
|
||||
end
|
||||
if minetest.registered_nodes[node_n_e.name].buildable_to then
|
||||
minetest.swap_node(north_east, {name="trunks:twig_11"})
|
||||
end
|
||||
end
|
||||
elseif twig_size == 22 then
|
||||
n1 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z})
|
||||
n2 = minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1})
|
||||
r1 = n1 and minetest.registered_nodes[n1.name]
|
||||
r2 = n2 and minetest.registered_nodes[n2.name]
|
||||
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_9", param2=1})
|
||||
end
|
||||
if minetest.registered_nodes[node_east.name].buildable_to then
|
||||
minetest.swap_node(east, {name="trunks:twig_10", param2=1})
|
||||
end
|
||||
if minetest.registered_nodes[node_s_e.name].buildable_to then
|
||||
minetest.swap_node(south_east, {name="trunks:twig_11", param2=1})
|
||||
end
|
||||
end
|
||||
elseif twig_size == 23 then
|
||||
n1 = minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1})
|
||||
n2 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1})
|
||||
r1 = n1 and minetest.registered_nodes[n1.name]
|
||||
r2 = n2 and minetest.registered_nodes[n2.name]
|
||||
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_9", param2=2})
|
||||
end
|
||||
if minetest.registered_nodes[node_south.name].buildable_to then
|
||||
minetest.swap_node(south, {name="trunks:twig_10", param2=2})
|
||||
end
|
||||
if minetest.registered_nodes[node_s_w.name].buildable_to then
|
||||
minetest.swap_node(south_west, {name="trunks:twig_11", param2=2})
|
||||
end
|
||||
end
|
||||
elseif twig_size == 24 then
|
||||
n1 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z})
|
||||
n2 = minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1})
|
||||
r1 = n1 and minetest.registered_nodes[n1.name]
|
||||
r2 = n2 and minetest.registered_nodes[n2.name]
|
||||
if not (r1 and r1.buildable_to or r2 and r2.buildable_to) then
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_9", param2=3})
|
||||
end
|
||||
if minetest.registered_nodes[node_west.name].buildable_to then
|
||||
minetest.swap_node(west, {name="trunks:twig_10", param2=3})
|
||||
end
|
||||
if minetest.registered_nodes[node_n_w.name].buildable_to then
|
||||
minetest.swap_node(north_west, {name="trunks:twig_11", param2=3})
|
||||
end
|
||||
end
|
||||
elseif twig_size <= 25 then
|
||||
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)})
|
||||
end
|
||||
elseif twig_size == 18 then
|
||||
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z-1})
|
||||
|
@ -1,8 +1,6 @@
|
||||
-- Code by Mossmanikin & Neuromancer
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("trunks")
|
||||
|
||||
local random = math.random
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- TWiGS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
@ -69,6 +67,7 @@ end
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- MoSS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
|
||||
-- wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
-- wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
|
||||
|
165
vines/init.lua
165
vines/init.lua
@ -11,8 +11,8 @@ local enable_side = minetest.settings:get_bool("vines_enable_side", true)
|
||||
local enable_jungle = minetest.settings:get_bool("vines_enable_jungle", true)
|
||||
local enable_willow = minetest.settings:get_bool("vines_enable_willow", true)
|
||||
|
||||
local rarity_roots = tonumber(minetest.settings:get("vines_rarity_roots")) or 0.5
|
||||
local default_rarity = 0.2
|
||||
local rarity_roots = tonumber(minetest.settings:get("vines_rarity_roots")) or 70
|
||||
local default_rarity = 95
|
||||
local rarity_standard = tonumber(minetest.settings:get("vines_rarity_standard")) or default_rarity
|
||||
local rarity_side = tonumber(minetest.settings:get("vines_rarity_side")) or default_rarity
|
||||
local rarity_jungle = tonumber(minetest.settings:get("vines_rarity_jungle")) or default_rarity
|
||||
@ -24,25 +24,6 @@ local growth_max = tonumber(minetest.settings:get("vines_growth_max")) or 360
|
||||
-- support for i18n
|
||||
local S = minetest.get_translator("vines")
|
||||
|
||||
local dids = {}
|
||||
local spawn_funcs = {}
|
||||
|
||||
local function find_open_side(pos) -- copied from biome_lib
|
||||
if minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name == "air" then
|
||||
return {newpos = { x=pos.x-1, y=pos.y, z=pos.z }, facedir = 2}
|
||||
end
|
||||
if minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name == "air" then
|
||||
return {newpos = { x=pos.x+1, y=pos.y, z=pos.z }, facedir = 3}
|
||||
end
|
||||
if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z-1 }).name == "air" then
|
||||
return {newpos = { x=pos.x, y=pos.y, z=pos.z-1 }, facedir = 4}
|
||||
end
|
||||
if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z+1 }).name == "air" then
|
||||
return {newpos = { x=pos.x, y=pos.y, z=pos.z+1 }, facedir = 5}
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-- ITEMS
|
||||
|
||||
if enable_vines ~= false then
|
||||
@ -55,8 +36,6 @@ end
|
||||
|
||||
-- FUNCTIONS
|
||||
|
||||
local random = math.random
|
||||
|
||||
local function on_dig(pos, node, player)
|
||||
if not player or minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
@ -106,7 +85,7 @@ local function ensure_vine_end(pos, oldnode)
|
||||
end
|
||||
|
||||
|
||||
vines.register_vine = function( name, defs, def )
|
||||
vines.register_vine = function( name, defs, biome )
|
||||
|
||||
local groups = {vines = 1, snappy = 3, flammable = 2}
|
||||
local vine_name_end = 'vines:' .. name .. '_end'
|
||||
@ -114,37 +93,16 @@ vines.register_vine = function( name, defs, def )
|
||||
local vine_image_end = "vines_" .. name .. "_end.png"
|
||||
local vine_image_middle = "vines_" .. name .. "_middle.png"
|
||||
|
||||
local spawn_plants = function(pos)
|
||||
local param2 = 0
|
||||
|
||||
if def.spawn_on_bottom then -- spawn under e.g. leaves
|
||||
local newpos = vector.new(pos.x, pos.y - 1, pos.z)
|
||||
if minetest.get_node(pos).name ~= "air" and minetest.get_node(newpos).name == "air" then
|
||||
-- (1) prevent floating vines; (2) is there even space?
|
||||
pos = newpos
|
||||
else
|
||||
return
|
||||
end
|
||||
elseif def.spawn_on_side then
|
||||
local onside = find_open_side(pos)
|
||||
if onside then
|
||||
pos = onside.newpos
|
||||
param2 = onside.facedir
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local spawn_plants = function(pos, fdir)
|
||||
local max_length = math.random(defs.average_length)
|
||||
local current_length = 1
|
||||
-- print("Generate " .. name .. " at " .. minetest.pos_to_string(pos))
|
||||
if minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' then
|
||||
while minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' and current_length < max_length do
|
||||
minetest.set_node(pos, { name = vine_name_middle, param2 = param2 })
|
||||
minetest.swap_node(pos, { name = vine_name_middle, param2 = fdir })
|
||||
pos.y = pos.y - 1
|
||||
current_length = current_length + 1
|
||||
end
|
||||
minetest.set_node(pos, { name = vine_name_end, param2 = param2 })
|
||||
minetest.set_node(pos, { name = vine_name_end, param2 = fdir })
|
||||
end
|
||||
end
|
||||
|
||||
@ -152,7 +110,7 @@ vines.register_vine = function( name, defs, def )
|
||||
local drawtype = 'signlike'
|
||||
|
||||
-- different properties for bottom and side vines.
|
||||
if not def.spawn_on_side then
|
||||
if not biome.spawn_on_side then
|
||||
|
||||
selection_box = {
|
||||
type = "fixed", fixed = { -0.4, -1/2, -0.4, 0.4, 1/2, 0.4 }
|
||||
@ -181,7 +139,7 @@ vines.register_vine = function( name, defs, def )
|
||||
on_construct = function(pos)
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(random(growth_min, growth_max))
|
||||
timer:start(math.random(growth_min, growth_max))
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
@ -191,7 +149,7 @@ vines.register_vine = function( name, defs, def )
|
||||
local bottom_node = minetest.get_node( bottom )
|
||||
if bottom_node.name == "air" then
|
||||
|
||||
if random(defs.average_length) ~= 1 then
|
||||
if math.random(defs.average_length) ~= 1 then
|
||||
|
||||
minetest.swap_node(pos, {
|
||||
name = vine_name_middle, param2 = node.param2})
|
||||
@ -201,7 +159,7 @@ vines.register_vine = function( name, defs, def )
|
||||
|
||||
local timer = minetest.get_node_timer(bottom_node)
|
||||
|
||||
timer:start(random(growth_min, growth_max))
|
||||
timer:start(math.random(growth_min, growth_max))
|
||||
end
|
||||
end
|
||||
end,
|
||||
@ -237,44 +195,9 @@ vines.register_vine = function( name, defs, def )
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
name = "vines:" .. name,
|
||||
decoration = {"air"},
|
||||
fill_ratio = def.rarity,
|
||||
y_min = -16,
|
||||
y_max = 48,
|
||||
place_on = def.place_on,
|
||||
deco_type = "simple",
|
||||
flags = "all_floors, all_ceilings"
|
||||
})
|
||||
dids[#dids + 1] = {name = name, spawn_func = spawn_plants}
|
||||
biome_lib.register_on_generate(biome, spawn_plants)
|
||||
end
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
for idx, def in ipairs(dids) do
|
||||
local did = minetest.get_decoration_id("vines:" .. def.name)
|
||||
dids[idx] = did
|
||||
spawn_funcs[did] = def.spawn_func
|
||||
end
|
||||
|
||||
minetest.set_gen_notify("decoration", dids)
|
||||
end)
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
local g = minetest.get_mapgen_object("gennotify")
|
||||
|
||||
for _, did in ipairs(dids) do
|
||||
local deco_locations = g["decoration#" .. did]
|
||||
|
||||
if deco_locations then
|
||||
local func = spawn_funcs[did]
|
||||
for _, pos in pairs(deco_locations) do
|
||||
func(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- ALIASES
|
||||
|
||||
-- used to remove the old vine nodes and give room for the new.
|
||||
@ -447,12 +370,19 @@ minetest.register_craft({
|
||||
if enable_roots ~= false then
|
||||
vines.register_vine('root',
|
||||
{description = S("Roots"), average_length = 9}, {
|
||||
place_on = {
|
||||
check_air = false,
|
||||
avoid_nodes = {"vines:root_middle"},
|
||||
avoid_radius = 5,
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt"
|
||||
},
|
||||
spawn_on_bottom = true,
|
||||
plantlife_limit = -0.6,
|
||||
rarity = rarity_roots,
|
||||
tries = 3,
|
||||
humidity_min = 0.4,
|
||||
temp_min = 0.4,
|
||||
})
|
||||
else
|
||||
minetest.register_alias('vines:root_middle', 'air')
|
||||
@ -463,14 +393,22 @@ end
|
||||
if enable_standard ~= false then
|
||||
vines.register_vine('vine',
|
||||
{description = S("Vines"), average_length = 5}, {
|
||||
place_on = {
|
||||
check_air = false,
|
||||
avoid_nodes = {"group:vines"},
|
||||
avoid_radius = 5,
|
||||
surface = {
|
||||
-- "default:leaves",
|
||||
"default:jungleleaves",
|
||||
"moretrees:jungletree_leaves_red",
|
||||
"moretrees:jungletree_leaves_yellow",
|
||||
"moretrees:jungletree_leaves_green"
|
||||
},
|
||||
spawn_on_bottom = true,
|
||||
plantlife_limit = -0.9,
|
||||
rarity = rarity_standard,
|
||||
tries = 1,
|
||||
humidity_min = 0.7,
|
||||
temp_min = 0.4,
|
||||
})
|
||||
else
|
||||
minetest.register_alias('vines:vine_middle', 'air')
|
||||
@ -481,14 +419,22 @@ end
|
||||
if enable_side ~= false then
|
||||
vines.register_vine('side',
|
||||
{description = S("Vines"), average_length = 6}, {
|
||||
place_on = {
|
||||
check_air = false,
|
||||
avoid_nodes = {"group:vines", "default:apple"},
|
||||
avoid_radius = 3,
|
||||
surface = {
|
||||
-- "default:leaves",
|
||||
"default:jungleleaves",
|
||||
"moretrees:jungletree_leaves_red",
|
||||
"moretrees:jungletree_leaves_yellow",
|
||||
"moretrees:jungletree_leaves_green"
|
||||
},
|
||||
spawn_on_side = true,
|
||||
plantlife_limit = -0.9,
|
||||
rarity = rarity_side,
|
||||
tries = 1,
|
||||
humidity_min = 0.4,
|
||||
temp_min = 0.4,
|
||||
})
|
||||
else
|
||||
minetest.register_alias('vines:side_middle', 'air')
|
||||
@ -499,25 +445,54 @@ end
|
||||
if enable_jungle ~= false then
|
||||
vines.register_vine("jungle",
|
||||
{description = S("Jungle Vines"), average_length = 7}, {
|
||||
place_on = {
|
||||
check_air = false,
|
||||
near_nodes = {
|
||||
"default:jungleleaves",
|
||||
"moretrees:jungletree_leaves_red",
|
||||
"moretrees:jungletree_leaves_yellow",
|
||||
"moretrees:jungletree_leaves_green"
|
||||
},
|
||||
near_nodes_size = 4,
|
||||
near_nodes_vertical = 4,
|
||||
avoid_nodes = {
|
||||
"vines:jungle_middle",
|
||||
"vines:jungle_end",
|
||||
},
|
||||
avoid_radius = 5,
|
||||
surface = {
|
||||
"default:jungletree",
|
||||
"moretrees:jungletree_trunk"
|
||||
},
|
||||
spawn_on_side = true,
|
||||
plantlife_limit = -0.9,
|
||||
rarity = rarity_jungle,
|
||||
tries = 1,
|
||||
humidity_min = 0.2,
|
||||
temp_min = 0.3,
|
||||
})
|
||||
else
|
||||
minetest.register_alias('vines:jungle_middle', 'air')
|
||||
minetest.register_alias('vines:jungle_end', 'air')
|
||||
end
|
||||
|
||||
-- WILLOW VINES (Note from 2024-06: Broken for years now, integration w/ new moretrees spawn mechanic needed)
|
||||
-- WILLOW VINES
|
||||
if enable_willow ~= false then
|
||||
vines.register_vine("willow",
|
||||
vines.register_vine( 'willow',
|
||||
{description = S("Willow Vines"), average_length = 9}, {
|
||||
check_air = false,
|
||||
avoid_nodes = {"vines:willow_middle"},
|
||||
avoid_radius = 5,
|
||||
near_nodes = {'default:water_source'},
|
||||
near_nodes_size = 1,
|
||||
near_nodes_count = 1,
|
||||
near_nodes_vertical = 7,
|
||||
plantlife_limit = -0.8,
|
||||
spawn_on_side = true,
|
||||
place_on = {"moretrees:willow_leaves"},
|
||||
surface = {"moretrees:willow_leaves"},
|
||||
rarity = rarity_willow,
|
||||
tries = 1,
|
||||
humidity_min = 0.5,
|
||||
temp_min = 0.5,
|
||||
})
|
||||
else
|
||||
minetest.register_alias('vines:willow_middle', 'air')
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = vines
|
||||
description = Adds climbable vines that are spawned on trees.
|
||||
depends = default
|
||||
optional_depends = moretrees, ebiomes
|
||||
depends = default, biome_lib
|
||||
optional_depends = moretrees
|
||||
|
@ -7,32 +7,32 @@ vines_enable_rope (Enable vine ropes) bool true
|
||||
#Enables root vines.
|
||||
vines_enable_roots (Enable root vines) bool true
|
||||
|
||||
#Rarity of root vines, from 1 to 10, lower numbers are rarer.
|
||||
vines_rarity_roots (Rarity of roots vines) float 0.5 1 0
|
||||
#Rarity of root vines, from 1 to 100, higher numbers are rarer.
|
||||
vines_rarity_roots (Rarity of roots vines) float 95 0 100
|
||||
|
||||
#Enables the standard type of vines.
|
||||
vines_enable_standard (Enable standard vines) bool true
|
||||
|
||||
#Rarity of standard vines, from 1 to 10, lower numbers are rarer.
|
||||
vines_rarity_standard (Rarity of standard vines) float 0.2 1 0
|
||||
#Rarity of standard vines, from 1 to 100, higher numbers are rarer.
|
||||
vines_rarity_standard (Rarity of standard vines) float 95 0 100
|
||||
|
||||
#Enables the type of vines that grow on the sides of leaf blocks.
|
||||
vines_enable_side (Enable side vines) bool true
|
||||
|
||||
#Rarity of side vines, from 1 to 10, lower numbers are rarer.
|
||||
vines_rarity_side (Rarity of side vines) float 0.2 1 0
|
||||
#Rarity of side vines, from 1 to 100, higher numbers are rarer.
|
||||
vines_rarity_side (Rarity of side vines) float 95 0 100
|
||||
|
||||
#Enables jungle style vines.
|
||||
vines_enable_jungle (Enable jungle vines) bool true
|
||||
|
||||
#Rarity of jungle vines, from 1 to 10, lower numbers are rarer.
|
||||
vines_rarity_jungle (Rarity of jungle vines) float 0.2 1 0
|
||||
#Rarity of jungle vines, from 1 to 100, higher numbers are rarer.
|
||||
vines_rarity_jungle (Rarity of jungle vines) float 95 0 100
|
||||
|
||||
#Enables willow vines.
|
||||
vines_enable_willow (Enable willow vines) bool true
|
||||
|
||||
#Rarity of willow vines, from 1 to 10, lower numbers are rarer.
|
||||
vines_rarity_willow (Rarity of willow vines) float 0.2 1 0
|
||||
#Rarity of willow vines, from 1 to 100, higher numbers are rarer.
|
||||
vines_rarity_willow (Rarity of willow vines) float 95 0 100
|
||||
|
||||
#Vine growth speed, minimum number of seconds between each growth.
|
||||
vines_growth_min (Minimum number of seconds between growth) int 180 1 3600
|
||||
|
@ -147,5 +147,3 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
timer:start(0)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.log("action", "[youngtrees] loaded.")
|
||||
|
Reference in New Issue
Block a user