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.
This commit is contained in:
CyberMango 2022-12-24 20:38:32 +02:00 committed by CyberMango
parent 8a7fcfde82
commit 0f569fdbaa
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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,