mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-11 18:50:27 +01:00
cave pearls and spindleshrooms (name subject to change) now are things. Not in mapgen yet.
This commit is contained in:
parent
5e113ec200
commit
38a77f3748
@ -372,6 +372,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
|
||||
end
|
||||
else
|
||||
data[vi] = c_coral_table[math.random(1,3)]
|
||||
data_param2[vi] = math.random(1,4)-1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -10,6 +10,7 @@ minetest.register_node("df_mapitems:cave_coral_3", {
|
||||
is_ground_content = true,
|
||||
drop = "default:coral_skeleton",
|
||||
light_source = 3,
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
@ -22,6 +23,7 @@ minetest.register_node("df_mapitems:cave_coral_2", {
|
||||
is_ground_content = true,
|
||||
drop = "default:coral_skeleton",
|
||||
light_source = 2,
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
@ -34,6 +36,7 @@ minetest.register_node("df_mapitems:cave_coral_1", {
|
||||
is_ground_content = true,
|
||||
drop = "default:coral_skeleton",
|
||||
light_source = 1,
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, dfcaverns_cave_coral = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
@ -46,7 +49,8 @@ minetest.register_abm{
|
||||
interval = 2,
|
||||
chance = 10,
|
||||
action = function(pos)
|
||||
minetest.swap_node(pos, {name=coral_names[math.random(1,3)]})
|
||||
local node = minetest.get_node(pos)
|
||||
minetest.swap_node(pos, {name=coral_names[math.random(1,3)], param2=node.param2})
|
||||
end,
|
||||
}
|
||||
|
||||
|
154
df_mapitems/cave_pearls.lua
Normal file
154
df_mapitems/cave_pearls.lua
Normal file
@ -0,0 +1,154 @@
|
||||
-- internationalization boilerplate
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
local pearl_on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
-- check if pointing at a node
|
||||
if not pt then
|
||||
return itemstack
|
||||
end
|
||||
if pt.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local under_pos = pt.under
|
||||
local above_pos = pt.above
|
||||
|
||||
local under_node = minetest.get_node(under_pos)
|
||||
local above_node = minetest.get_node(above_pos)
|
||||
|
||||
if minetest.is_protected(above_pos, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(above_pos, placer:get_player_name())
|
||||
return
|
||||
end
|
||||
|
||||
local under_name = under_node.name
|
||||
local above_name = above_node.name
|
||||
local under_def = minetest.registered_nodes[under_name]
|
||||
local above_def = minetest.registered_nodes[above_name]
|
||||
|
||||
-- return if any of the nodes is not registered
|
||||
if not under_def or not above_def then
|
||||
return itemstack
|
||||
end
|
||||
-- check if you can replace the node above the pointed node
|
||||
if not above_def.buildable_to then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local dir = vector.subtract(under_pos, above_pos)
|
||||
local param2
|
||||
if dir.x > 0 then
|
||||
--facing +x: 16, 17, 18, 19,
|
||||
param2 = 15 + math.random(1,4)
|
||||
elseif dir.x < 0 then
|
||||
--facing -x: 12, 13, 14, 15
|
||||
param2 = 11 + math.random(1,4)
|
||||
elseif dir.z > 0 then
|
||||
--facing +z: 8, 9, 10, 11
|
||||
param2 = 7 + math.random(1,4)
|
||||
elseif dir.z < 0 then
|
||||
--facing -z: 4, 5, 6, 7
|
||||
param2 = 3 + math.random(1,4)
|
||||
elseif dir.y > 0 then
|
||||
--facing -y: 20, 21, 22, 23 (ceiling)
|
||||
param2 = 19 + math.random(1,4)
|
||||
else
|
||||
--facing +y: 0, 1, 2, 3 (floor)
|
||||
param2 = math.random(1,4) - 1
|
||||
end
|
||||
|
||||
-- add the node and remove 1 item from the itemstack
|
||||
minetest.add_node(above_pos, {name = itemstack:get_name(), param2 = param2})
|
||||
if not minetest.setting_getbool("creative_mode") and not minetest.check_player_privs(placer, "creative") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local valid_mounting_node = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if not node then return false end
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if not def then return false end
|
||||
if def.buildable_to then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
local add_to_table = function(dest, source)
|
||||
for _, val in ipairs(source) do
|
||||
table.insert(dest, val)
|
||||
end
|
||||
end
|
||||
|
||||
local get_valid_facedirs = function(pos)
|
||||
local dirs = {}
|
||||
if valid_mounting_node(vector.add(pos, {x=1,y=0,z=0})) then
|
||||
add_to_table(dirs, {16, 17, 18, 19})
|
||||
end
|
||||
if valid_mounting_node(vector.add(pos, {x=-1,y=0,z=0})) then
|
||||
add_to_table(dirs, {12, 13, 14, 15})
|
||||
end
|
||||
if valid_mounting_node(vector.add(pos, {x=0,y=1,z=0})) then
|
||||
add_to_table(dirs, {0, 1, 2, 3})
|
||||
end
|
||||
if valid_mounting_node(vector.add(pos, {x=0,y=-1,z=0})) then
|
||||
add_to_table(dirs, {20, 21, 22, 23})
|
||||
end
|
||||
if valid_mounting_node(vector.add(pos, {x=0,y=0,z=1})) then
|
||||
add_to_table(dirs, {8, 9, 10, 11})
|
||||
end
|
||||
if valid_mounting_node(vector.add(pos, {x=0,y=0,z=-1})) then
|
||||
add_to_table(dirs, {4, 5, 6, 7})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("df_mapitems:wall_pearls", {
|
||||
description = S("Cave Pearls"),
|
||||
tiles = {"dfcaverns_cave_pearl.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 2},
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
light_source = 4,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.375, -0.5, -0.375, -0.125, -0.3125, -0.125}, -- NodeBox1
|
||||
{0.125, -0.5, -0.1875, 0.3125, -0.375, 0}, -- NodeBox2
|
||||
{-0.125, -0.5, 0.25, 0.0625, -0.375, 0.4375}, -- NodeBox3
|
||||
}
|
||||
},
|
||||
on_place = pearl_on_place,
|
||||
})
|
||||
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_pearls = minetest.get_content_id("df_mapitems:wall_pearls")
|
||||
|
||||
--facing +x: 16, 17, 18, 19,
|
||||
--facing -x: 12, 13, 14, 15
|
||||
--facing +z: 8, 9, 10, 11
|
||||
--facing -z: 4, 5, 6, 7
|
||||
--facing -y: 20, 21, 22, 23, (ceiling)
|
||||
df_mapitems.place_wall_pearls = function(vi, area, data, data_param2)
|
||||
if data[vi] == c_air then
|
||||
if data[vi+1] == c_stone then -- positive X
|
||||
data[vi] = c_pearls
|
||||
data_param2[vi] = 15 + math.random(1,4)
|
||||
elseif data[vi-1] == c_stone then -- negative X
|
||||
data[vi] = c_pearls
|
||||
data_param2[vi] = 11 + math.random(1,4)
|
||||
elseif data[vi+area.zstride] == c_stone then -- positive Z
|
||||
data[vi] = c_pearls
|
||||
data_param2[vi] = 7 + math.random(1,4)
|
||||
elseif data[vi-area.zstride] == c_stone then -- negative Z
|
||||
data[vi] = c_pearls
|
||||
data_param2[vi] = 3 + math.random(1,4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -17,4 +17,5 @@ dofile(modpath.."/cave_coral.lua")
|
||||
dofile(modpath.."/crystals_mese.lua")
|
||||
dofile(modpath.."/crystals_ruby.lua")
|
||||
|
||||
dofile(modpath.."/veinstone.lua")
|
||||
dofile(modpath.."/veinstone.lua")
|
||||
dofile(modpath.."/cave_pearls.lua")
|
BIN
df_mapitems/textures/dfcaverns_cave_pearl.png
Normal file
BIN
df_mapitems/textures/dfcaverns_cave_pearl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 489 B |
@ -125,9 +125,12 @@ minetest.register_node("df_trees:fungiwood_sapling", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
|
@ -154,9 +154,12 @@ minetest.register_node("df_trees:goblin_cap_sapling", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
|
@ -62,5 +62,5 @@ dofile(modpath.."/goblin_cap.lua")
|
||||
dofile(modpath.."/tower_cap.lua")
|
||||
|
||||
dofile(modpath.."/torchspine.lua")
|
||||
|
||||
dofile(modpath.."/spindleshroom.lua")
|
||||
|
||||
|
246
df_trees/spindleshroom.lua
Normal file
246
df_trees/spindleshroom.lua
Normal file
@ -0,0 +1,246 @@
|
||||
-- internationalization boilerplate
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
-- Copied from subterrane's features.lua
|
||||
-- Figured that was nicer than adding a dependency for just this little bit
|
||||
local stal_on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
-- check if pointing at a node
|
||||
if not pt then
|
||||
return itemstack
|
||||
end
|
||||
if pt.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
local above = minetest.get_node(pt.above)
|
||||
|
||||
if minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pt.above, placer:get_player_name())
|
||||
return
|
||||
end
|
||||
|
||||
-- return if any of the nodes is not registered
|
||||
if not minetest.registered_nodes[under.name] or not minetest.registered_nodes[above.name] then
|
||||
return itemstack
|
||||
end
|
||||
-- check if you can replace the node above the pointed node
|
||||
if not minetest.registered_nodes[above.name].buildable_to then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local new_param2
|
||||
-- check if pointing at an existing stalactite
|
||||
if minetest.get_item_group(under.name, "spindleshroom") ~= 0 then
|
||||
new_param2 = under.param2
|
||||
else
|
||||
new_param2 = math.random(0,3)
|
||||
end
|
||||
|
||||
-- add the node and remove 1 item from the itemstack
|
||||
minetest.add_node(pt.above, {name = itemstack:get_name(), param2 = new_param2})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local growth_delay = function()
|
||||
return math.random(
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)
|
||||
end
|
||||
|
||||
local disp = 0.0625 -- adjusting position a bit
|
||||
|
||||
minetest.register_node("df_trees:spindleshroom_stem", {
|
||||
description = S("Spindleshroom Stem"),
|
||||
is_ground_content = true,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindleshroom = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tiles = {
|
||||
"dfcaverns_tower_cap.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625+disp, -0.5, -0.125+disp, 0.1875+disp, 0.5, 0.25+disp},
|
||||
{-0.125+disp, -0.5, -0.0625+disp, 0.25+disp, 0.5, 0.1875+disp},
|
||||
}
|
||||
},
|
||||
on_place = stal_on_place,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "df_trees:spindleshroom_stem",
|
||||
burntime = 5,
|
||||
})
|
||||
|
||||
local cap_def = function(item_name, seedling_item, color_name, color_code, light_level)
|
||||
return {
|
||||
description = S("@1 Spindleshroom Cap", color_name),
|
||||
is_ground_content = true,
|
||||
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindleshroom = 1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tiles = {
|
||||
"dfcaverns_tower_cap.png^[multiply:#"..color_code,
|
||||
},
|
||||
light_source = light_level,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875+disp, -0.5, -0.3125+disp, 0.3125+disp, -0.3125, 0.4375+disp},
|
||||
{-0.3125+disp, -0.5, -0.1875+disp, 0.4375+disp, -0.3125, 0.3125+disp},
|
||||
{-0.0625+disp, -0.1875, -0.0625+disp, 0.1875+disp, -0.125, 0.1875+disp},
|
||||
{-0.1875+disp, -0.3125, -0.1875+disp, 0.3125+disp, -0.1875, 0.3125+disp},
|
||||
}
|
||||
},
|
||||
|
||||
drop = {
|
||||
-- Maximum number of items to drop
|
||||
max_items = 1,
|
||||
-- Choose max_items randomly from this list
|
||||
items = {
|
||||
{
|
||||
items = {item_name, seedling_item}, -- Items to drop
|
||||
rarity = 2, -- Probability of dropping is 1 / rarity
|
||||
},
|
||||
{
|
||||
items = {item_name, seedling_item, seedling_item}, -- Items to drop
|
||||
rarity = 2, -- Probability of dropping is 1 / rarity
|
||||
},
|
||||
{
|
||||
items = {item_name, seedling_item, seedling_item, seedling_item}, -- Items to drop
|
||||
rarity = 2, -- Probability of dropping is 1 / rarity
|
||||
},
|
||||
{
|
||||
items = {item_name}, -- Items to drop
|
||||
rarity = 1, -- Probability of dropping is 1 / rarity
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
on_place = stal_on_place,
|
||||
on_timer = function(pos, elapsed)
|
||||
local above = vector.add(pos, {x=0,y=1,z=0})
|
||||
local node_above = minetest.get_node(above)
|
||||
local above_def = minetest.registered_nodes[node_above.name]
|
||||
if not above_def or not above_def.buildable_to then
|
||||
-- can't grow any more, exit
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local height = meta:get_int("spindleshroom_to_grow")
|
||||
local node = minetest.get_node(pos)
|
||||
minetest.set_node(pos, {name="df_trees:spindleshroom_stem", param2 = node.param2})
|
||||
minetest.set_node(above, {name=item_name, param2 = node.param2})
|
||||
height = height - 1
|
||||
if height > 0 then
|
||||
meta = minetest.get_meta(above)
|
||||
meta:set_int("spindleshroom_to_grow", height)
|
||||
minetest.get_node_timer(above):start(growth_delay())
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local seedling_construct = function(pos)
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(growth_delay())
|
||||
end
|
||||
end
|
||||
|
||||
local seedling_def = function(item_name, color_name, color_code)
|
||||
return {
|
||||
description = S("@1 Spindleshroom Spawn", color_name),
|
||||
_doc_items_longdesc = nil,
|
||||
_doc_items_usagehelp = nil,
|
||||
tiles = {
|
||||
"dfcaverns_tower_cap.png^[multiply:#"..color_code,
|
||||
},
|
||||
groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, digtron_on_place=1},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
floodable = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625 + 0.125, -0.5, -0.125 + 0.125, 0.125 + 0.125, -0.375, 0.0625 + 0.125},
|
||||
}
|
||||
},
|
||||
|
||||
on_place = stal_on_place,
|
||||
on_construct = seedling_construct,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local node = minetest.get_node(pos)
|
||||
minetest.set_node(pos, {name=item_name, param2 = node.param2})
|
||||
local meta = minetest.get_meta(pos)
|
||||
local height = math.random(1,5)-1
|
||||
if height > 0 then
|
||||
meta:set_int("spindleshroom_to_grow", height)
|
||||
minetest.get_node_timer(pos):start(growth_delay())
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local register_spindleshroom_type = function(item_suffix, colour_name, colour_code, light_level)
|
||||
local cap_item = "df_trees:spindleshroom_cap"..item_suffix
|
||||
local seedling_item = "df_trees:spindleshroom_seedling"..item_suffix
|
||||
minetest.register_node(cap_item,
|
||||
cap_def(cap_item, seedling_item, colour_name, colour_code, light_level)
|
||||
)
|
||||
minetest.register_node(seedling_item,
|
||||
seedling_def(cap_item, colour_name, colour_code)
|
||||
)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = cap_item,
|
||||
burntime = 10,
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = seedling_item,
|
||||
burntime = 3,
|
||||
})
|
||||
|
||||
local c_stem = minetest.get_content_id("df_trees:spindleshroom_stem")
|
||||
local c_cap = minetest.get_content_id(cap_item)
|
||||
|
||||
return function(vi, area, data, data_param2)
|
||||
local stem_height = math.random(1,5)-1
|
||||
local param2 = math.random(1,4)-1
|
||||
local i = 0
|
||||
while i < stem_height do
|
||||
index = vi + i * area.ystride
|
||||
data[index] = c_stem
|
||||
data_param2[index] = param2
|
||||
i = i + 1
|
||||
end
|
||||
index = vi + i * area.ystride
|
||||
data[index] = c_cap
|
||||
data_param2[index] = param2
|
||||
end
|
||||
end
|
||||
|
||||
df_trees.spawn_spindleshroom_white_vm = register_spindleshroom_type("_white", S("White"), "FFFFFF", 0)
|
||||
df_trees.spawn_spindleshroom_cyan_vm = register_spindleshroom_type("_cyan", S("Cyan"), "C3FFFF", 2)
|
||||
df_trees.spawn_spindleshroom_red_vm = register_spindleshroom_type("_red", S("Red"), "FFC3C3", 4)
|
||||
df_trees.spawn_spindleshroom_green_vm = register_spindleshroom_type("_green", S("Green"), "C3FFC3", 2)
|
||||
df_trees.spawn_spindleshroom_red_vm = register_spindleshroom_type("_golden", S("Golden"), "FFFFC3", 12)
|
@ -167,9 +167,12 @@ minetest.register_node("df_trees:spore_tree_sapling", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
|
@ -136,9 +136,12 @@ minetest.register_node("df_trees:tower_cap_sapling", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
|
@ -295,9 +295,12 @@ minetest.register_node("df_trees:tunnel_tube_sapling", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
|
||||
if minetest.get_item_group(below_node.name, "soil") > 0 then
|
||||
minetest.get_node_timer(pos):start(math.random(
|
||||
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_min_growth_delay,
|
||||
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos)
|
||||
|
Loading…
Reference in New Issue
Block a user