cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user