builder improvements

This commit is contained in:
kepler155c@gmail.com
2017-06-15 03:25:55 -04:00
parent 71cbf34ade
commit 3f66a9397c
5 changed files with 245 additions and 262 deletions

View File

@@ -29,20 +29,25 @@ function ChestProvider:refresh()
entry = self.cache[key]
if not entry then
local meta = self.p.getItemMeta(k) -- slow method.. cache for speed
entry = {
id = s.name,
dmg = s.damage,
name = meta.displayName,
max_size = meta.maxCount,
}
self.cache[key] = entry
if meta then
entry = {
id = s.name,
dmg = s.damage,
name = meta.displayName,
max_size = meta.maxCount,
}
self.cache[key] = entry
end
end
if entry then
entry = Util.shallowCopy(entry)
self.items[key] = entry
entry.qty = 0
end
entry = Util.shallowCopy(entry)
self.items[key] = entry
entry.qty = 0
end
entry.qty = entry.qty + s.count
if entry then
entry.qty = entry.qty + s.count
end
end
end
return self.items