From 5ada2b417cda2c7c121c626a61e1d380ae9414fc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 4 Nov 2020 12:58:33 +0100 Subject: [PATCH] Use "minetest", not "core" --- hunger.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hunger.lua b/hunger.lua index acd63a8..687ae49 100644 --- a/hunger.lua +++ b/hunger.lua @@ -7,11 +7,11 @@ function hbhunger.load_hunger(player) end -- wrapper for minetest.item_eat (this way we make sure other mods can't break this one) -local org_eat = core.do_item_eat -core.do_item_eat = function(hp_change, replace_with_item, itemstack, user, pointed_thing) +local org_eat = minetest.do_item_eat +minetest.do_item_eat = function(hp_change, replace_with_item, itemstack, user, pointed_thing) local old_itemstack = itemstack itemstack = hbhunger.eat(hp_change, replace_with_item, itemstack, user, pointed_thing) - for _, callback in pairs(core.registered_on_item_eats) do + for _, callback in pairs(minetest.registered_on_item_eats) do local result = callback(hp_change, replace_with_item, itemstack, user, pointed_thing, old_itemstack) if result then return result @@ -39,7 +39,7 @@ function hbhunger.eat(hp_change, replace_with_item, itemstack, user, pointed_thi def = {} if type(hp_change) ~= "number" then hp_change = 1 - core.log("error", "Wrong on_use() definition for item '" .. item .. "'") + minetest.log("error", "Wrong on_use() definition for item '" .. item .. "'") end def.saturation = hp_change * 1.3 def.replace = replace_with_item