diff options
Diffstat (limited to 'farming')
-rw-r--r-- | farming/crops/potato.lua | 11 | ||||
-rw-r--r-- | farming/hoes.lua | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/farming/crops/potato.lua b/farming/crops/potato.lua index 1547fc0..256ce97 100644 --- a/farming/crops/potato.lua +++ b/farming/crops/potato.lua @@ -14,7 +14,16 @@ minetest.register_craftitem("farming:potato", { on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") end, - on_use = minetest.item_eat(1), +-- on_use = minetest.item_eat(1), + on_use = function(itemstack, user, pointed_thing) + if user then + if math.random(1, 3) == 1 then + return minetest.do_item_eat(-1, nil, itemstack, user, pointed_thing) + else + return minetest.do_item_eat(1, nil, itemstack, user, pointed_thing) + end + end + end, }) -- baked potato diff --git a/farming/hoes.lua b/farming/hoes.lua index 6ffa98f..430d0f7 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -433,7 +433,7 @@ minetest.register_tool("farming:scythe_mithril", { -- Run script hook for _, callback in pairs(core.registered_on_dignodes) do - callback(pos, node) + callback(pos, node, placer) end -- play sound |