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 for slot,v in pairs(ni.getInventory().list()) do
local key = itemDB:makeKey(v) local key = itemDB:makeKey(v)
if key == food then if key == food then
local item = ni.getInventory().getItem(slot) local item = ni.getInventory().getItemDetail(slot)
if item and item.consume then if item and item.saturation then
return item return slot
end end
break break
end end
@@ -87,7 +87,7 @@ Event.onInterval(5, function()
if context.state.food and ni.getMetaOwner().food.hungry then if context.state.food and ni.getMetaOwner().food.hungry then
local item = getFood(context.state.food) local item = getFood(context.state.food)
if item then if item then
item.consume() ni.getInventory().consume(item)
end end
end end
end) end)