mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2025-01-08 01:00:25 +01:00
add support for caverealms mushroom sapling
This commit is contained in:
parent
9bc52e2042
commit
54b856158c
10
init.lua
10
init.lua
@ -202,11 +202,8 @@ local function check_crops(pos, nodename, strength)
|
|||||||
particle_effect(pos)
|
particle_effect(pos)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -400,13 +397,12 @@ function bonemeal:on_use(pos, strength, node)
|
|||||||
|
|
||||||
default.grow_papyrus(pos, node)
|
default.grow_papyrus(pos, node)
|
||||||
particle_effect(pos)
|
particle_effect(pos)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
elseif node.name == "default:cactus" then
|
elseif node.name == "default:cactus" then
|
||||||
|
|
||||||
default.grow_cactus(pos, node)
|
default.grow_cactus(pos, node)
|
||||||
particle_effect(pos)
|
particle_effect(pos)
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -423,8 +419,8 @@ function bonemeal:on_use(pos, strength, node)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- check for tree growth if pointing at sapling
|
-- check for tree growth if pointing at sapling
|
||||||
if minetest.get_item_group(node.name, "sapling") > 0
|
-- if minetest.get_item_group(node.name, "sapling") > 0
|
||||||
and math.random(1, (5 - strength)) == 1 then
|
if math.random(1, (5 - strength)) == 1 then
|
||||||
check_sapling(pos, node.name)
|
check_sapling(pos, node.name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
17
mods.lua
17
mods.lua
@ -123,3 +123,20 @@ elseif minetest.get_modpath("technic_worldgen") then
|
|||||||
{"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"},
|
{"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if minetest.get_modpath("caverealms") then
|
||||||
|
|
||||||
|
local fil = minetest.get_modpath("caverealms") .. "/schematics/shroom.mts"
|
||||||
|
local add_shroom = function(pos)
|
||||||
|
|
||||||
|
minetest.swap_node(pos, {name = "air"})
|
||||||
|
|
||||||
|
minetest.place_schematic(
|
||||||
|
{x = pos.x - 5, y = pos.y, z = pos.z - 5}, fil, 0, nil, false)
|
||||||
|
end
|
||||||
|
|
||||||
|
bonemeal:add_sapling({
|
||||||
|
{"caverealms:mushroom_sapling", add_shroom, "soil"},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user