if (linked) {
result = new LinkedHashMap<ItemIdentifier, Integer>();
} else {
result = new HashMap<ItemIdentifier, Integer>();
}
IStorageMonitorable tmp = tile.getMonitorable(dir, source);
for (IAEItemStack items : tmp.getItemInventory().getStorageList()) {
ItemIdentifier ident = ItemIdentifier.get(items.getItemStack());
Integer count = result.get(ident);
if (count != null) {
result.put(ident, (int) (count + items.getStackSize() - (hideOnePerStack ? 1 : 0)));
} else {