add df_primordial_items saplings

This commit is contained in:
tenplus1 2022-07-01 14:36:36 +01:00
parent e163e815d6
commit 4a0eddef02
4 changed files with 31 additions and 6 deletions

View File

@ -11,3 +11,4 @@ ferns?
dryplants?
df_trees?
df_farming?
df_primordial_items?

View File

@ -493,11 +493,9 @@ function bonemeal:on_use(pos, strength, node)
light_ok = nil
end
-- check for tree growth if pointing at sapling
if (minetest.get_item_group(node.name, "sapling") > 0
or node.name == "default:large_cactus_seedling")
and random(5 - strength) == 1 then
check_sapling(pos, node.name, light_ok)
-- check for sapling growth
if random(5 - strength) == 1
and check_sapling(pos, node.name, light_ok) then
return true
end

View File

@ -1,4 +1,4 @@
name = bonemeal
depends = default
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming, df_primordial_items
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings.

View File

@ -228,3 +228,29 @@ if minetest.get_modpath("df_farming") then
{"df_farming:sweet_pod_", 6, "df_farming:sweet_pod_seed", true}
})
end
if minetest.get_modpath("df_primordial_items") then
local function mush_fix(pos)
minetest.set_node(pos, {name = "air"})
mapgen_helper.place_schematic(pos,
df_primordial_items.get_primordial_mushroom(), (math.random(1,4)-1)*90)
end
local function fern_fix(pos)
minetest.set_node(pos, {name = "air"})
local rotations = {0, 90, 180, 270}
mapgen_helper.place_schematic(pos,
df_primordial_items.get_fern_schematic(), rotations[math.random(1,#rotations)])
end
bonemeal:add_sapling({
{"df_primordial_items:jungle_mushroom_sapling",
df_primordial_items.spawn_jungle_mushroom, "soil", true},
{"df_primordial_items:jungletree_sapling",
df_primordial_items.spawn_jungle_tree, "soil", true},
{"df_primordial_items:mush_sapling", mush_fix, "soil", true},
{"df_primordial_items:fern_sapling", fern_fix, "soil", true}
})
end