From d4cf76b8e8c85006f6bd81e4fa85bacbbf40e983 Mon Sep 17 00:00:00 2001 From: kepler155c Date: Sat, 6 Jan 2018 22:31:54 -0500 Subject: [PATCH] cleanup --- apis/chestAdapter18.lua | 10 +--------- apis/itemDB.lua | 9 +-------- apps/shapes.lua | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/apis/chestAdapter18.lua b/apis/chestAdapter18.lua index e74526a..ae705d4 100644 --- a/apis/chestAdapter18.lua +++ b/apis/chestAdapter18.lua @@ -39,7 +39,7 @@ function ChestAdapter:getCachedItemDetails(item, k) local s, detail = pcall(self.getItemMeta, k) if not s or not detail or detail.name ~= item.name then - debug({ s, detail }) +-- debug({ s, detail }) -- error('Inventory has changed') return end @@ -126,9 +126,6 @@ function ChestAdapter:provide(item, qty, slot, direction) end end end) - if not s then - debug(m) - end return s, m end @@ -141,8 +138,6 @@ function ChestAdapter:eject(item, qty, direction) (not item.damage or stack.damage == item.damage) and (not item.nbtHash or stack.nbtHash == item.nbtHash) then local amount = math.min(maxStack, math.min(qty, stack.count)) -debug({ key, amount }) -debug(stack) if amount > 0 then self.drop(key, amount, direction) end @@ -153,9 +148,6 @@ debug(stack) end end end) - if not s then - debug(m) - end return s, m end diff --git a/apis/itemDB.lua b/apis/itemDB.lua index d71d771..27ba771 100644 --- a/apis/itemDB.lua +++ b/apis/itemDB.lua @@ -98,8 +98,6 @@ function itemDB:add(baseItem) -- if detail.maxDamage > 0 then -- nItem.damage = '*' -- end -debug('--') -debug('adding ' .. makeKey(nItem)) nItem.displayName = safeString(baseItem.displayName) nItem.maxCount = baseItem.maxCount @@ -108,31 +106,26 @@ debug('adding ' .. makeKey(nItem)) for k,item in pairs(self.data) do if nItem.name == item.name and nItem.displayName == item.displayName then -debug('found: ' .. makeKey(item)) + if nItem.nbtHash ~= item.nbtHash and nItem.damage ~= item.damage then nItem.damage = '*' nItem.nbtHash = nil nItem.ignoreNBT = true self.data[k] = nil - debug('removing all ' .. makeKey(nItem)) break elseif nItem.damage ~= item.damage then nItem.damage = '*' self.data[k] = nil - debug('removing damage ' .. makeKey(nItem)) break elseif nItem.nbtHash ~= item.nbtHash then nItem.nbtHash = nil nItem.ignoreNBT = true - debug('removing nbt ' .. makeKey(nItem)) self.data[k] = nil break end end end -debug('final ' .. makeKey(nItem)) - TableDB.add(self, makeKey(nItem), nItem) nItem = Util.shallowCopy(nItem) nItem.damage = baseItem.damage diff --git a/apps/shapes.lua b/apps/shapes.lua index e50a005..ac47f75 100644 --- a/apps/shapes.lua +++ b/apps/shapes.lua @@ -89,7 +89,7 @@ function page:runFunction(id, script) local fn, msg = loadstring(script, 'script') if not fn then self.notification:error('Error in script') - debug(msg) + --debug(msg) return end