tweak crop growth, add df_farming crops

This commit is contained in:
tenplus1 2022-06-30 12:48:18 +01:00
parent 5f81c3dfa2
commit bb34fbae3d
4 changed files with 29 additions and 2 deletions

View File

@ -10,3 +10,4 @@ dye?
ferns? ferns?
dryplants? dryplants?
df_trees? df_trees?
df_farming?

View File

@ -218,12 +218,25 @@ local function check_crops(pos, nodename, strength)
crop = nodename:split(":")[2] crop = nodename:split(":")[2]
-- get stage number or set to 0 for seed -- get stage number or set to 0 for seed
stage = tonumber( crop:split("_")[2] ) or 0 if crop:split("_")[3] then
stage = crop:split("_")[3]
else
stage = crop:split("_")[2]
end
stage = tonumber(stage) or 0
stage = min(stage + strength, crops[n][2]) stage = min(stage + strength, crops[n][2])
-- check for place_param setting -- check for place_param setting
nod = crops[n][1] .. stage nod = crops[n][1] .. stage
def = minetest.registered_nodes[nod] def = minetest.registered_nodes[nod]
-- make sure crop exists or isn't fully grown already
if not def or nod == nodename then
return false
end
def = def and def.place_param2 or 0 def = def and def.place_param2 or 0
minetest.set_node(pos, {name = nod, param2 = def}) minetest.set_node(pos, {name = nod, param2 = def})

View File

@ -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 optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming
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.

View File

@ -208,3 +208,16 @@ if minetest.get_modpath("df_trees") then
{"df_trees:tunnel_tube_sapling", df_trees.spawn_tunnel_tube, "soil"} {"df_trees:tunnel_tube_sapling", df_trees.spawn_tunnel_tube, "soil"}
}) })
end end
if minetest.get_modpath("df_farming") then
bonemeal:add_crop({
{"df_farming:cave_wheat_", 8, "df_farming:cave_wheat_seed"},
{"df_farming:dimple_cup_", 4, "df_farming:dimple_cup_seed"},
{"df_farming:pig_tail_", 8, "df_farming:pig_tail_seed"},
{"df_farming:plump_helmet_", 4, "df_farming:plump_helmet_spawn"},
{"df_farming:quarry_bush_", 5, "df_farming:quarry_bush_seed"},
{"df_farming:sweet_pod_", 6, "df_farming:sweet_pod_seed"}
})
end