From 5c7350b78f390dfe7be17c8615ad44f643c5c70f Mon Sep 17 00:00:00 2001 From: kabou Date: Sat, 30 Apr 2022 04:06:43 +0200 Subject: [PATCH] Add bonemealing callback to saplings. * Adds a _mcl_on_bonemealing callback to the sapling node definitions. --- mods/ITEMS/mcl_core/nodes_trees.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index 54a43d6bf..947b17f5c 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -205,6 +205,14 @@ local function register_sapling(subname, description, longdesc, tt_help, texture nn == "mcl_core:podzol" or nn == "mcl_core:podzol_snow" or nn == "mcl_core:dirt" or nn == "mcl_core:mycelium" or nn == "mcl_core:coarse_dirt" end), + _mcl_on_bonemealing = function(pointed_thing, placer) + local pos = pointed_thing.under + local n = minetest.get_node(pos) + -- Saplings: 45% chance to advance growth stage + if math.random(1,100) <= 45 then + return mcl_core.grow_sapling(pos, n) + end + end, node_placement_prediction = "", _mcl_blast_resistance = 0, _mcl_hardness = 0,