]> git.lizzy.rs Git - xdecor.git/blobdiff - crafts.lua
Bowl of soup : use minetest.item_eat when hunger mod installed
[xdecor.git] / crafts.lua
index 84f8bef6b50d7030aeb50311c3ce4914300b717a..269ebadb92134302e98b068eef66d58454030807 100644 (file)
@@ -37,9 +37,12 @@ minetest.register_craftitem("xdecor:bowl_soup", {
        groups = {not_in_creative_inventory = 1},
        stack_max = 1,
        on_use = function(itemstack, user, _)
-               local inv = user:get_inventory()
                itemstack:replace("xdecor:bowl 1")
-               user:set_hp(20)
+               if minetest.get_modpath("hunger") then
+                       minetest.item_eat(20)
+               else
+                       user:set_hp(20)
+               end
                return itemstack
        end
 })