Add x_farming bonemeal support for trees

This commit is contained in:
Juraj Vajda 2023-03-01 16:28:59 -05:00
parent 5c2f92e19b
commit 70f47ef977
7 changed files with 116 additions and 3 deletions

View File

@ -75,4 +75,5 @@ read_globals = {
"xpanes", "xpanes",
"XTumbleweed", "XTumbleweed",
"x_obsidianmese", "x_obsidianmese",
"x_farming",
} }

View File

@ -109,7 +109,8 @@
"walls", "walls",
"stairs", "stairs",
"XTumbleweed", "XTumbleweed",
"x_obsidianmese" "x_obsidianmese",
"x_farming"
] ]
} }
} }

View File

@ -71,6 +71,7 @@ https://bitbucket.org/minetest_gamers/everness/issues
- walls - walls
- x_obsidianmese (for paths) - x_obsidianmese (for paths)
- x_tumbleweed (adds tumbleweeds to deserts) - x_tumbleweed (adds tumbleweeds to deserts)
- x_farming (bonemeal, recipes...)
## License ## License

View File

@ -178,7 +178,7 @@ end
-- Mod Support -- Mod Support
-- --
if minetest.get_modpath('x_farming') then if minetest.get_modpath('x_farming') and minetest.global_exists('x_farming') then
dofile(path .. '/mod_support_x_farming.lua') dofile(path .. '/mod_support_x_farming.lua')
end end
@ -188,6 +188,7 @@ end
if minetest.get_modpath('x_obsidianmese') if minetest.get_modpath('x_obsidianmese')
and minetest.global_exists('x_obsidianmese') and minetest.global_exists('x_obsidianmese')
-- backwards compatibility check
and x_obsidianmese.register_path_node and x_obsidianmese.register_path_node
then then
dofile(path .. '/mod_support_x_obsidianmese.lua') dofile(path .. '/mod_support_x_obsidianmese.lua')

View File

@ -1,6 +1,6 @@
name = everness name = everness
description = Never ending discovery in Everness mapgen. description = Never ending discovery in Everness mapgen.
depends = default depends = default
optional_depends = xpanes, doors, stairs, walls, x_obsidianmese, x_tumbleweed optional_depends = xpanes, doors, stairs, walls, x_obsidianmese, x_tumbleweed, x_farming
supported_games = minetest_game supported_games = minetest_game
min_minetest_version = 5.4 min_minetest_version = 5.4

View File

@ -16,6 +16,101 @@
License along with this library; if not, write to juraj.vajda@gmail.com License along with this library; if not, write to juraj.vajda@gmail.com
--]] --]]
--
-- Bonemeal Trees
--
x_farming.x_bonemeal:register_tree_defs({
{
-- sapling name
name = 'everness:coral_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:coral_tree_bioluminescent_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:crystal_bush_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:cursed_bush_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:baobab_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:dry_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:willow_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:sequoia_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:crystal_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:crystal_tree_large_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
{
-- sapling name
name = 'everness:cursed_dream_tree_sapling',
-- 1 out of `chance`, e.g. 2 = 50% chance
chance = 3,
-- grow tree from sapling
grow_tree = Everness.grow_sapling
},
})
-- --
-- Recipes -- Recipes
-- --

View File

@ -54,6 +54,20 @@ function Everness.grow_willow_tree(pos)
local path = minetest.get_modpath('everness') .. '/schematics/everness_willow_tree_from_sapling.mts' local path = minetest.get_modpath('everness') .. '/schematics/everness_willow_tree_from_sapling.mts'
minetest.place_schematic({ x = pos.x - 19, y = pos.y, z = pos.z - 19 }, minetest.place_schematic({ x = pos.x - 19, y = pos.y, z = pos.z - 19 },
path, 'random', nil, false) path, 'random', nil, false)
-- trigger vines
minetest.after(1, function(v_pos)
local size = { x = 39, y = 27, z = 39 }
local positions = minetest.find_nodes_in_area(
vector.round(vector.new(v_pos.x - (size.x / 2), v_pos.y, v_pos.z - (size.z / 2))),
vector.round(vector.new(v_pos.x + (size.x / 2), v_pos.y + size.y, v_pos.z + (size.z / 2))),
{ 'group:vine' }
)
for _, vine_pos in ipairs(positions) do
Everness:tick_vine(vine_pos)
end
end, pos)
end end
function Everness.grow_sequoia_tree(pos) function Everness.grow_sequoia_tree(pos)