From d07e8d95364e9067b57d95fc454424806b57eac1 Mon Sep 17 00:00:00 2001 From: kabou Date: Sat, 30 Apr 2022 06:19:16 +0200 Subject: [PATCH] Add bonemealing callback to melons. * Adds a _mcl_on_bonemealing callback to the unripe melon plants. --- mods/ITEMS/mcl_farming/melon.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index 205150b6e..deda6ba10 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -109,6 +109,12 @@ for s=1,7 do groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, dig_by_water=1,destroy_by_lava_flow=1, plant_melon_stem=s}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, + _mcl_on_bonemealing = function(pointed_thing, placer) + local pos = pointed_thing.under + local n = minetest.get_node(pos) + local stages = math.random(2, 5) + return mcl_farming:grow_plant("plant_melon_stem", pos, n, stages, true) + end }) end