2016-05-17 23:40:05 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- translator and protection check setting
|
2016-06-09 17:08:34 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
local S = minetest.get_translator("ethereal")
|
2024-03-16 15:10:37 +03:00
|
|
|
local sapling_protection_check = minetest.settings:get_bool(
|
|
|
|
"ethereal.sapling_protection_check", false)
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- sapling placement helper
|
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
local function prepare_on_place(itemstack, placer, pointed_thing, name, w, h)
|
|
|
|
|
|
|
|
if sapling_protection_check then
|
|
|
|
|
|
|
|
-- check if grown tree area intersects any players protected area
|
|
|
|
return default.sapling_on_place(itemstack, placer, pointed_thing,
|
2024-08-16 13:05:33 +03:00
|
|
|
name, {x = -w, y = 1, z = -w}, {x = w, y = h, z = w}, 4)
|
2024-03-16 15:10:37 +03:00
|
|
|
end
|
|
|
|
|
2024-05-10 10:21:16 +03:00
|
|
|
-- Position of sapling
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
local node = minetest.get_node_or_nil(pos)
|
|
|
|
local pdef = node and minetest.registered_nodes[node.name]
|
|
|
|
|
|
|
|
-- Check if node clicked on has it's own on_rightclick function
|
|
|
|
if pdef and pdef.on_rightclick
|
2024-08-16 13:05:33 +03:00
|
|
|
and not (placer and placer:is_player() and placer:get_player_control().sneak) then
|
2024-05-10 10:21:16 +03:00
|
|
|
return pdef.on_rightclick(pos, node, placer, itemstack, pointed_thing)
|
|
|
|
end
|
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
-- place normally
|
|
|
|
return minetest.item_place_node(itemstack, placer, pointed_thing)
|
|
|
|
end
|
|
|
|
|
2023-06-08 18:06:57 +03:00
|
|
|
-- Basandra Bush Sapling
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2023-06-08 18:06:57 +03:00
|
|
|
minetest.register_node("ethereal:basandra_bush_sapling", {
|
|
|
|
description = S("Basandra Bush Sapling"),
|
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"ethereal_basandra_bush_sapling.png"},
|
|
|
|
inventory_image = "ethereal_basandra_bush_sapling.png",
|
|
|
|
wield_image = "ethereal_basandra_bush_sapling.png",
|
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
2024-08-16 13:05:33 +03:00
|
|
|
type = "fixed", fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
|
2023-06-08 18:06:57 +03:00
|
|
|
},
|
|
|
|
groups = {snappy = 2, dig_immediate = 3, attached_node = 1, ethereal_sapling = 1,
|
|
|
|
sapling = 1},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
2024-03-16 15:10:37 +03:00
|
|
|
grown_height = 2,
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
return prepare_on_place(itemstack, placer, pointed_thing,
|
|
|
|
"ethereal:basandra_bush_sapling", 1, 2)
|
|
|
|
end
|
2023-06-08 18:06:57 +03:00
|
|
|
})
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2016-05-17 23:40:05 +03:00
|
|
|
-- Bamboo Sprout
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2016-05-17 23:40:05 +03:00
|
|
|
minetest.register_node("ethereal:bamboo_sprout", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Bamboo Sprout"),
|
2024-09-05 10:09:34 +03:00
|
|
|
drawtype = "plantlike",
|
2021-04-02 23:06:43 +03:00
|
|
|
tiles = {"ethereal_bamboo_sprout.png"},
|
|
|
|
inventory_image = "ethereal_bamboo_sprout.png",
|
|
|
|
wield_image = "ethereal_bamboo_sprout.png",
|
2016-05-17 23:40:05 +03:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
groups = {
|
2018-03-12 20:04:13 +03:00
|
|
|
food_bamboo_sprout = 1, snappy = 3, attached_node = 1, flammable = 2,
|
2018-03-25 20:52:22 +03:00
|
|
|
dig_immediate = 3, ethereal_sapling = 1, sapling = 1,
|
2016-05-17 23:40:05 +03:00
|
|
|
},
|
|
|
|
sounds = default.node_sound_defaults(),
|
|
|
|
selection_box = {
|
2024-08-26 10:20:35 +03:00
|
|
|
type = "fixed", fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, -0.1, 3 / 16}
|
2016-05-17 23:40:05 +03:00
|
|
|
},
|
2017-01-08 12:56:09 +03:00
|
|
|
on_use = minetest.item_eat(2),
|
2024-03-16 15:10:37 +03:00
|
|
|
grown_height = 11,
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
return prepare_on_place(itemstack, placer, pointed_thing,
|
|
|
|
"ethereal:bamboo_sprout", 1, 18)
|
|
|
|
end
|
2016-05-17 23:40:05 +03:00
|
|
|
})
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- register Sapling helper
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
local function register_sapling(name, desc, texture, width, height)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
minetest.register_node(name .. "_sapling", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S(desc .. " Tree Sapling"),
|
2015-07-25 18:45:29 +03:00
|
|
|
drawtype = "plantlike",
|
2016-05-17 23:40:05 +03:00
|
|
|
tiles = {texture .. ".png"},
|
|
|
|
inventory_image = texture .. ".png",
|
|
|
|
wield_image = texture .. ".png",
|
2015-07-25 18:45:29 +03:00
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
2024-08-16 13:05:33 +03:00
|
|
|
type = "fixed", fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
2015-07-25 18:45:29 +03:00
|
|
|
},
|
|
|
|
groups = {
|
|
|
|
snappy = 2, dig_immediate = 3, flammable = 2,
|
2017-01-08 12:56:09 +03:00
|
|
|
ethereal_sapling = 1, attached_node = 1, sapling = 1
|
2015-07-25 18:45:29 +03:00
|
|
|
},
|
2016-12-22 00:23:13 +03:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
2024-03-16 15:10:37 +03:00
|
|
|
grown_height = height,
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
return prepare_on_place(itemstack, placer, pointed_thing,
|
|
|
|
name .. "_sapling", width, height)
|
|
|
|
end
|
2015-07-25 18:45:29 +03:00
|
|
|
})
|
2014-11-09 22:17:41 +03:00
|
|
|
end
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- add saplings
|
|
|
|
|
2024-03-16 15:10:37 +03:00
|
|
|
register_sapling("ethereal:willow", "Willow", "ethereal_willow_sapling", 5, 14)
|
|
|
|
register_sapling("ethereal:yellow_tree", "Healing", "ethereal_yellow_tree_sapling", 4, 19)
|
|
|
|
register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 4, 7)
|
|
|
|
register_sapling("ethereal:banana_tree", "Banana", "ethereal_banana_tree_sapling", 3, 8)
|
|
|
|
register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 4, 19)
|
|
|
|
register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 4, 11)
|
2024-08-16 13:05:33 +03:00
|
|
|
register_sapling("ethereal:mushroom_brown", "Brown Mushroom",
|
|
|
|
"ethereal_mushroom_brown_sapling", 1, 11)
|
2024-03-16 15:10:37 +03:00
|
|
|
register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 4, 9)
|
2021-08-20 13:25:33 +03:00
|
|
|
register_sapling("ethereal:giant_redwood", "Giant Redwood",
|
2024-03-16 15:10:37 +03:00
|
|
|
"ethereal_giant_redwood_sapling", 7, 33)
|
|
|
|
register_sapling("ethereal:redwood", "Redwood", "ethereal_redwood_sapling", 4, 21)
|
|
|
|
register_sapling("ethereal:orange_tree", "Orange", "ethereal_orange_tree_sapling", 2, 6)
|
|
|
|
register_sapling("ethereal:birch", "Birch", "moretrees_birch_sapling", 2, 7)
|
|
|
|
register_sapling("ethereal:sakura", "Sakura", "ethereal_sakura_sapling", 4, 10)
|
|
|
|
register_sapling("ethereal:lemon_tree", "Lemon", "ethereal_lemon_tree_sapling", 2, 7)
|
|
|
|
register_sapling("ethereal:olive_tree", "Olive", "ethereal_olive_tree_sapling", 3, 10)
|
2020-12-12 23:04:59 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- add tree schematic
|
2018-09-30 20:29:35 +03:00
|
|
|
|
2024-09-01 15:13:26 +03:00
|
|
|
local function add_tree(pos, schem, replace)
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-10-10 11:15:06 +03:00
|
|
|
-- minetest.swap_node(pos, {name = "air"})
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-09-01 15:13:26 +03:00
|
|
|
minetest.place_schematic(pos, schem, "random", replace, false,
|
|
|
|
"place_center_x, place_center_z")
|
2015-04-25 14:41:36 +03:00
|
|
|
end
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- get mod path and schematic folder
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2018-09-30 20:29:35 +03:00
|
|
|
local path = minetest.get_modpath("ethereal") .. "/schematics/"
|
2015-07-25 18:45:29 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- global tree grow functions
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2023-06-08 18:06:57 +03:00
|
|
|
function ethereal.grow_basandra_bush(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.basandrabush)
|
2023-06-08 18:06:57 +03:00
|
|
|
end
|
|
|
|
|
2016-05-17 23:40:05 +03:00
|
|
|
function ethereal.grow_yellow_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.yellowtree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_big_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.bigtree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_banana_tree(pos)
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-04-17 14:15:33 +03:00
|
|
|
if math.random(2) == 1 and minetest.find_node_near(pos, 1, {"farming:soil_wet"}) then
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.bananatree,
|
2022-09-30 19:26:44 +03:00
|
|
|
{{"ethereal:banana", "ethereal:banana_bunch"}})
|
2020-08-11 14:14:52 +03:00
|
|
|
else
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.bananatree)
|
2020-08-11 14:14:52 +03:00
|
|
|
end
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_frost_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.frosttrees)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_mushroom_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.mushroomone)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
2024-05-07 09:34:52 +03:00
|
|
|
function ethereal.grow_mushroom_brown_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.mushroomtwo)
|
2024-05-07 09:34:52 +03:00
|
|
|
end
|
|
|
|
|
2016-05-17 23:40:05 +03:00
|
|
|
function ethereal.grow_palm_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.palmtree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_willow_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.willow)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_redwood_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.redwood_small_tree)
|
2021-08-20 13:25:33 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_giant_redwood_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.redwood_tree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_orange_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.orangetree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_bamboo_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.bambootree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_birch_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.birchtree)
|
2016-05-17 23:40:05 +03:00
|
|
|
end
|
|
|
|
|
2019-02-16 15:23:14 +03:00
|
|
|
function ethereal.grow_sakura_tree(pos)
|
2021-11-27 13:54:46 +03:00
|
|
|
|
2019-02-20 18:21:36 +03:00
|
|
|
if math.random(10) == 1 then
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.sakura_tree,
|
2022-09-30 19:26:44 +03:00
|
|
|
{{"ethereal:sakura_leaves", "ethereal:sakura_leaves2"}})
|
2019-02-20 18:21:36 +03:00
|
|
|
else
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.sakura_tree)
|
2019-02-20 18:21:36 +03:00
|
|
|
end
|
2019-02-16 15:23:14 +03:00
|
|
|
end
|
|
|
|
|
2020-12-12 23:04:59 +03:00
|
|
|
function ethereal.grow_lemon_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.lemontree)
|
2020-12-12 23:04:59 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function ethereal.grow_olive_tree(pos)
|
2024-09-01 15:13:26 +03:00
|
|
|
add_tree(pos, ethereal.olivetree)
|
2020-12-12 23:04:59 +03:00
|
|
|
end
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- return True if sapling has enough height room to grow
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
local function enough_height(pos, height)
|
2016-07-14 15:12:44 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
return minetest.line_of_sight(
|
2016-07-14 15:12:44 +03:00
|
|
|
{x = pos.x, y = pos.y + 1, z = pos.z},
|
|
|
|
{x = pos.x, y = pos.y + height, z = pos.z})
|
|
|
|
end
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- global function run by Abm
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
function ethereal.grow_sapling(pos, node)
|
2023-04-22 10:06:16 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
if (minetest.get_node_light(pos) or 0) < 13 then return end
|
2015-07-24 13:11:22 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- get node below sapling
|
2022-09-30 19:26:44 +03:00
|
|
|
local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name
|
2024-08-16 13:05:33 +03:00
|
|
|
local def = minetest.registered_nodes[node.name] ; if not def then return end
|
2024-09-01 15:13:26 +03:00
|
|
|
local height = def.grown_height or 33
|
2016-07-14 15:12:44 +03:00
|
|
|
|
2016-07-14 15:40:49 +03:00
|
|
|
-- do we have enough height to grow sapling into tree?
|
2024-08-16 13:05:33 +03:00
|
|
|
if not height or not enough_height(pos, height) then return end
|
2016-07-14 15:40:49 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- check if Ethereal Sapling is growing on correct substrate
|
2023-06-08 18:06:57 +03:00
|
|
|
if node.name == "ethereal:basandra_bush_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:fiery_dirt" then ethereal.grow_basandra_bush(pos)
|
2023-06-08 18:06:57 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:yellow_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and minetest.get_item_group(under, "soil") > 0 then ethereal.grow_yellow_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:big_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "default:dirt_with_grass" then ethereal.grow_big_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:banana_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:grove_dirt" then ethereal.grow_banana_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:frost_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:crystal_dirt" then ethereal.grow_frost_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:mushroom_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:mushroom_dirt" then ethereal.grow_mushroom_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
2024-05-07 09:34:52 +03:00
|
|
|
elseif node.name == "ethereal:mushroom_brown_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:mushroom_dirt" then ethereal.grow_mushroom_brown_tree(pos)
|
2024-05-07 09:34:52 +03:00
|
|
|
|
2015-07-25 18:45:29 +03:00
|
|
|
elseif node.name == "ethereal:palm_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "default:sand" then ethereal.grow_palm_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:willow_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:gray_dirt" then ethereal.grow_willow_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:redwood_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "default:dirt_with_dry_grass" then ethereal.grow_redwood_tree(pos)
|
2015-07-25 18:45:29 +03:00
|
|
|
|
2021-08-20 13:25:33 +03:00
|
|
|
elseif node.name == "ethereal:giant_redwood_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "default:dirt_with_dry_grass" then ethereal.grow_giant_redwood_tree(pos)
|
2021-08-20 13:25:33 +03:00
|
|
|
|
2015-07-25 18:45:29 +03:00
|
|
|
elseif node.name == "ethereal:orange_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:prairie_dirt" then ethereal.grow_orange_tree(pos)
|
2015-08-31 19:40:29 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:bamboo_sprout"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:bamboo_dirt" then ethereal.grow_bamboo_tree(pos)
|
2015-11-14 13:21:06 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:birch_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "default:dirt_with_grass" then ethereal.grow_birch_tree(pos)
|
2019-10-27 17:57:43 +03:00
|
|
|
|
2019-02-16 18:12:29 +03:00
|
|
|
elseif node.name == "ethereal:sakura_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:bamboo_dirt" then ethereal.grow_sakura_tree(pos)
|
2020-12-12 23:04:59 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:olive_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:grove_dirt" then ethereal.grow_olive_tree(pos)
|
2020-12-12 23:04:59 +03:00
|
|
|
|
|
|
|
elseif node.name == "ethereal:lemon_tree_sapling"
|
2024-08-16 13:05:33 +03:00
|
|
|
and under == "ethereal:grove_dirt" then ethereal.grow_lemon_tree(pos) end
|
2015-07-24 13:11:22 +03:00
|
|
|
end
|
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
-- grow saplings Abm
|
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_abm({
|
2016-08-19 19:22:09 +03:00
|
|
|
label = "Ethereal grow sapling",
|
2014-11-09 22:17:41 +03:00
|
|
|
nodenames = {"group:ethereal_sapling"},
|
2017-06-17 23:34:36 +03:00
|
|
|
interval = 10,
|
|
|
|
chance = 50,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2024-08-16 13:05:33 +03:00
|
|
|
action = ethereal.grow_sapling -- (pos, node)
|
2015-10-01 21:01:07 +03:00
|
|
|
})
|
2021-08-20 13:25:33 +03:00
|
|
|
|
|
|
|
-- 2x redwood saplings make 1x giant redwood sapling
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2021-08-20 13:25:33 +03:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "ethereal:giant_redwood_sapling",
|
|
|
|
recipe = {{"ethereal:redwood_sapling", "ethereal:redwood_sapling"}}
|
|
|
|
})
|