From 0f569fdbaad89768fec63ee506782164cf99a7ba Mon Sep 17 00:00:00 2001 From: CyberMango Date: Sat, 24 Dec 2022 20:38:32 +0200 Subject: [PATCH] Bone meal on sweet berries in creative mode is no longer wasted and minor fixes. removed an unnecessary -- in a comment. Removed a redundant concatination. --- mods/ITEMS/mcl_farming/shared_functions.lua | 2 +- mods/ITEMS/mcl_farming/sweet_berry.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index 989274c438..bbb5cdc201 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -472,7 +472,7 @@ end --[[Get a callback that either eats the item or plants it. Used for on_place callbacks for craft items which are seeds that can also be consumed. ---]] +]] function mcl_farming:get_seed_or_eat_callback(plantname, hp_change) return function(itemstack, placer, pointed_thing) local new = mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 4682447df4..86c27c182a 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -53,7 +53,9 @@ for i=0, 3 do end if mcl_dye and clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then mcl_dye.apply_bone_meal({under=pos},clicker) - itemstack:take_item() + if not minetest.is_creative_enabled(pn) then + itemstack:take_item() + end return end @@ -61,7 +63,7 @@ for i=0, 3 do for j=1, berries_to_drop[math.random(2)] do minetest.add_item(pos, "mcl_farming:sweet_berry") end - minetest.swap_node(pos, {name = "mcl_farming:sweet_berry_bush_" .. 1 }) + minetest.swap_node(pos, {name = "mcl_farming:sweet_berry_bush_1"}) end return itemstack end,