forked from mtcontrib/bonemeal
add df_primordial_items saplings
This commit is contained in:
parent
e163e815d6
commit
4a0eddef02
@ -11,3 +11,4 @@ ferns?
|
|||||||
dryplants?
|
dryplants?
|
||||||
df_trees?
|
df_trees?
|
||||||
df_farming?
|
df_farming?
|
||||||
|
df_primordial_items?
|
||||||
|
8
init.lua
8
init.lua
@ -493,11 +493,9 @@ function bonemeal:on_use(pos, strength, node)
|
|||||||
light_ok = nil
|
light_ok = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check for tree growth if pointing at sapling
|
-- check for sapling growth
|
||||||
if (minetest.get_item_group(node.name, "sapling") > 0
|
if random(5 - strength) == 1
|
||||||
or node.name == "default:large_cactus_seedling")
|
and check_sapling(pos, node.name, light_ok) then
|
||||||
and random(5 - strength) == 1 then
|
|
||||||
check_sapling(pos, node.name, light_ok)
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,4 +1,4 @@
|
|||||||
name = bonemeal
|
name = bonemeal
|
||||||
depends = default
|
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.
|
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings.
|
||||||
|
26
mods.lua
26
mods.lua
@ -228,3 +228,29 @@ if minetest.get_modpath("df_farming") then
|
|||||||
{"df_farming:sweet_pod_", 6, "df_farming:sweet_pod_seed", true}
|
{"df_farming:sweet_pod_", 6, "df_farming:sweet_pod_seed", true}
|
||||||
})
|
})
|
||||||
end
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user