forked from mtcontrib/minetest_hbhunger
Use minetest.override_item
This commit is contained in:
parent
f028f6c8d8
commit
be3d491cf8
@ -57,8 +57,7 @@ end
|
|||||||
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
|
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
|
||||||
local tab = minetest.registered_items[name]
|
local tab = minetest.registered_items[name]
|
||||||
if tab == nil then return end
|
if tab == nil then return end
|
||||||
tab.on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal)
|
minetest.override_item(name, {on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal) })
|
||||||
minetest.registered_items[name] = tab
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("default") ~= nil then
|
if minetest.get_modpath("default") ~= nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user