1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2024-12-23 08:20:20 +01:00

Use minetest.override_item

This commit is contained in:
Wuzzy 2016-08-05 14:28:19 +02:00
parent f028f6c8d8
commit be3d491cf8

View File

@ -57,8 +57,7 @@ end
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
local tab = minetest.registered_items[name]
if tab == nil then return end
tab.on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal)
minetest.registered_items[name] = tab
minetest.override_item(name, {on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal) })
end
if minetest.get_modpath("default") ~= nil then