]> git.lizzy.rs Git - xdecor.git/commitdiff
Bowl of soup : use minetest.item_eat when hunger mod installed
authorkilbith <jeanpatrick.guerrero@gmail.com>
Mon, 4 Jan 2016 16:05:28 +0000 (17:05 +0100)
committerkilbith <jeanpatrick.guerrero@gmail.com>
Tue, 5 Jan 2016 10:46:11 +0000 (11:46 +0100)
crafts.lua
worktable.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
 })
index 5e97f61bfa714a11cbe86da2f2636029a5680769..7220b264be3420c865f13d8c49894079c41704bb 100644 (file)
@@ -50,7 +50,8 @@ function worktable.craft_output_recipe(pos, start_i, pagenum, stackname, recipe_
                        button[4.6,0.2;0.7,0.5;clearfilter;X]
                        button[0,0;1.5,1;backcraft;< Back]
                        tooltip[search;Search]
-                       tooltip[clearfilter;Reset] ]]..
+                       tooltip[clearfilter;Reset]
+                       label[3,5.8;Input] ]]..
                        "list[context;inv_items_list;0,1;8,4;"..tostring(start_i).."]"..
                        "table[6.1,0.2;1.1,0.5;pagenum;#FFFF00,"..tostring(math.floor(pagenum))..
                        ",#FFFFFF,/ "..tostring(pagemax).."]"..