WIP: Try to update Milo for 1.19 #63

Draft
Kan18 wants to merge 27 commits from Kan18/develop-1.8 into develop-1.8
Showing only changes of commit a9202a7034 - Show all commits

View File

@@ -58,9 +58,9 @@ local function getFood(food)
for slot,v in pairs(ni.getInventory().list()) do
local key = itemDB:makeKey(v)
if key == food then
local item = ni.getInventory().getItem(slot)
if item and item.consume then
return item
local item = ni.getInventory().getItemDetail(slot)
if item and item.saturation then
return slot
end
break
end
@@ -87,7 +87,7 @@ Event.onInterval(5, function()
if context.state.food and ni.getMetaOwner().food.hungry then
local item = getFood(context.state.food)
if item then
item.consume()
ni.getInventory().consume(item)
end
end
end)
@@ -101,4 +101,4 @@ return {
callback = function()
UI:setPage(page)
end,
}
}