]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/cake/init.lua
remove server debug
[Crafter.git] / mods / cake / init.lua
index 2cb5b263eb0389d0ec70786fdd4d22a54a3b086d..3fdd844e1ddc525bb9b0e1c921d99b9c2f09bb21 100644 (file)
@@ -3,6 +3,15 @@
 -- Namespace: test
 -- 
 -- the higher it is the more it's "eaten"
+
+minetest.register_food("cake:cake_item_placeholder",{
+       description = "",
+       texture = "nothing.png",
+       satiation=30,
+       hunger=6,
+})
+
+
 for i = 0,13 do
        local missing_slice
        if i == 0 then
@@ -34,11 +43,12 @@ for i = 0,13 do
                on_construct = function(pos)
                        --randomly cake eats itself
                        if math.random() > 0.995 then
-                               minetest.set_node(pos, {name="cake:cursed_cake_1"})
+                               minetest.set_node(pos, {name="cake:cursed_cake_0"})
                        end
                end,
                on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
-                       clicker:set_hp(clicker:get_hp()+5)
+                       player_eat_food(clicker,"cake:cake_item_placeholder")
+                       --clicker:set_hp(clicker:get_hp()+5)
                        if i == 13 then
                        minetest.sound_play("eat_finish",{pos=pos,gain=0.2,pitch=math.random(90,100)/100})
                        minetest.remove_node(pos)
@@ -84,6 +94,7 @@ for i = 0,13 do
                        timer:start(0.2)
                end,
                on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
+                       player_eat_food(clicker,"cake:cake_item_placeholder")
                        clicker:set_hp(clicker:get_hp()-5)
                end,
                on_timer = function(pos, elapsed)
@@ -101,7 +112,7 @@ end
 
 
 minetest.register_craft({
-       output = "cake:cake_1",
+       output = "cake:cake_0",
        recipe = {
                {"weather:snowball","weather:snowball","weather:snowball"},
                {"farming:wheat","farming:wheat","farming:wheat"},