diff --git a/milo/apis/miniAdapter.lua b/milo/apis/miniAdapter.lua index f400cab..12a22e2 100644 --- a/milo/apis/miniAdapter.lua +++ b/milo/apis/miniAdapter.lua @@ -24,19 +24,10 @@ function Adapter:listItems(throttle) local key = table.concat({ v.name, v.damage, v.nbtHash }, ':') local entry = cache[key] - if not entry then - local cached = itemDB:get(v, function() return self.getItemMeta(k) end) - if cached then - entry = cached - entry.count = 0 - cache[key] = entry - else - _G._debug('Adapter: failed to get item details') - end - end - if entry then entry.count = entry.count + v.count + else + cache[key] = itemDB:get(v, function() return self.getItemMeta(k) end) end throttle() end diff --git a/milo/plugins/turtleLearn.lua b/milo/plugins/turtleLearn.lua index b5c4ba2..1071297 100644 --- a/milo/plugins/turtleLearn.lua +++ b/milo/plugins/turtleLearn.lua @@ -1,4 +1,3 @@ -local Craft = require('craft2') local itemDB = require('itemDB') local Milo = require('milo') local UI = require('ui') @@ -7,8 +6,6 @@ local Util = require('util') local colors = _G.colors local turtle = _G.turtle -local context = Milo:getContext() - local function learnRecipe() local ingredients = Milo:getTurtleInventory()