From 21f0c7750bf222772e389450d210f509d3095aaf Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Tue, 27 Jun 2023 17:00:42 -0600 Subject: [PATCH] Throw experience points after food is cooked --- mods/ITEMS/mcl_campfires/api.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/mcl_campfires/api.lua b/mods/ITEMS/mcl_campfires/api.lua index 7dc5b65f4..82b92da35 100644 --- a/mods/ITEMS/mcl_campfires/api.lua +++ b/mods/ITEMS/mcl_campfires/api.lua @@ -138,6 +138,10 @@ function mcl_campfires.cook_item(pos, elapsed) meta:set_string("food_z_"..tostring(i), nil) end minetest.add_item(pos, cooked.item) -- Drop Cooked Item + -- Throw some Experience Points because why not? + -- Food is cooked, xp is deserved for using this unique cooking method. Take that Minecraft ;) + local dir = vector.divide(minetest.facedir_to_dir(minetest.get_node(pos).param2),-1.95) + mcl_experience.throw_xp(vector.add(pos, dir), 1) inv:set_stack("main", i, "") -- Clear Inventory continue = continue + 1 -- Indicate that the slot is clear. end